📄 activator.java
字号:
package org.riawork.demo.user.validator;
/*
* RIAWork.org
*
* OSGI Opendoc Demo
*/
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.riawork.demo.service.user.Validator;
import org.riawork.demo.service.user.impl.LDAPValidatorImpl;
/**
* desc: LDAPValidatorBundle Activator,采用传统的方式完成服务的注册
*
* @author jerry
*/
public class Activator implements BundleActivator {
// --------------------------------------------Instance Variables
private ServiceRegistration serviceReg=null;
// --------------------------------------------Public Method
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
serviceReg=context.registerService(Validator.class.getName(), new LDAPValidatorImpl(), null);
}
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
if(serviceReg!=null)
serviceReg.unregister();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -