📄 usermanageractivator.java
字号:
/* * @(#)UserManagerActivator.java. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */package cn.edu.ynu.sei.dict.plugin.user.service;import cn.edu.ynu.sei.dict.plugin.db.connector.service.IDatabaseConnector;import cn.edu.ynu.sei.dict.plugin.user.UserManager;import java.util.Hashtable;import org.osgi.framework.BundleActivator;import org.osgi.framework.BundleContext;import org.osgi.framework.ServiceReference;/** * StoneAge User Management Service activator for OSGi. * @author zy * @version 1.0.0.0, Mar 13, 2008 */public class UserManagerActivator implements BundleActivator { private IUserManager userManager; private IDatabaseConnector databaseConnector; @Override public void start(BundleContext bundleContext) throws Exception { ServiceReference sr = bundleContext.getServiceReference(IDatabaseConnector.class.getName()); databaseConnector = (IDatabaseConnector) bundleContext.getService(sr); userManager = new UserManager(databaseConnector); bundleContext.registerService(IUserManager.class.getName(), userManager, new Hashtable()); } @Override public void stop(BundleContext arg0) throws Exception { userManager = null; databaseConnector = null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -