public class BaseActivator extends Object implements org.osgi.framework.BundleActivator, Runnable, ThreadFactory
| Modifier and Type | Field and Description |
|---|---|
protected org.osgi.framework.BundleContext |
bundleContext |
protected ExecutorService |
executor |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
BaseActivator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose() |
protected void |
doOpen() |
protected void |
doStart() |
protected void |
doStop() |
protected boolean |
ensureStartupConfiguration(String configId) |
protected boolean |
getBoolean(String key,
boolean def)
Called in
doStart(). |
protected Class<?>[] |
getClassesArray(String key,
String def) |
protected Dictionary<String,?> |
getConfiguration() |
protected int |
getInt(String key,
int def)
Called in
doStart(). |
protected String[] |
getInterfaceNames(Object object) |
protected long |
getLong(String key,
long def)
Called in
doStart(). |
long |
getSchedulerStopTimeout() |
protected String |
getString(String key,
String def)
Called in
doStart(). |
protected String[] |
getStringArray(String key,
String def) |
protected <T> T |
getTrackedService(Class<T> clazz)
Called in
doStart(). |
protected <T> org.osgi.framework.ServiceReference<T> |
getTrackedServiceRef(Class<T> clazz) |
protected void |
manage(String pid)
Called in
doOpen(). |
Thread |
newThread(Runnable r) |
protected void |
reconfigure() |
protected void |
register(Class[] clazz,
Object service)
Called in
doStart(). |
protected void |
register(Class[] clazz,
Object service,
Dictionary<String,?> props)
Called in
doStart(). |
protected <T> void |
register(Class<T> clazz,
T service)
Called in
doStart(). |
protected <T> void |
register(Class<T> clazz,
T service,
Dictionary<String,?> props)
Called in
doStart(). |
protected void |
registerMBean(Object mbean,
String type)
Called in
doStart(). |
protected void |
registerMBeanWithName(Object mbean,
String name)
Called in
doStart(). |
void |
run() |
void |
setSchedulerStopTimeout(long schedulerStopTimeout) |
void |
start(org.osgi.framework.BundleContext context) |
void |
stop(org.osgi.framework.BundleContext context) |
protected void |
trackService(Class<?> clazz)
Called in
doOpen(). |
protected void |
trackService(Class<?> clazz,
String filter)
Called in
doOpen(). |
protected void |
trackService(String className,
String filter) |
void |
updated(Dictionary<String,?> properties) |
protected final org.slf4j.Logger logger
protected org.osgi.framework.BundleContext bundleContext
protected ExecutorService executor
public long getSchedulerStopTimeout()
public void setSchedulerStopTimeout(long schedulerStopTimeout)
public void start(org.osgi.framework.BundleContext context)
throws Exception
start in interface org.osgi.framework.BundleActivatorExceptionpublic void stop(org.osgi.framework.BundleContext context)
throws Exception
stop in interface org.osgi.framework.BundleActivatorExceptionprotected void doClose()
protected void doStop()
protected boolean ensureStartupConfiguration(String configId) throws IOException
IOExceptionprotected void manage(String pid)
doOpen().pid - The configuration PID to manage (ManagedService).public void updated(Dictionary<String,?> properties)
protected Dictionary<String,?> getConfiguration()
protected int getInt(String key, int def)
doStart().key - The configuration keydef - The default value.protected boolean getBoolean(String key, boolean def)
doStart().key - The configuration key.def - The default value.protected long getLong(String key, long def)
doStart().key - The configuration key.def - The default value.protected String getString(String key, String def)
doStart().key - The configuration key.def - The default value.protected void reconfigure()
protected void trackService(Class<?> clazz) throws org.osgi.framework.InvalidSyntaxException
doOpen().clazz - The service interface to track.org.osgi.framework.InvalidSyntaxException - If the tracker syntax is not correct.protected void trackService(Class<?> clazz, String filter) throws org.osgi.framework.InvalidSyntaxException
doOpen().clazz - The service interface to track.filter - The filter to use to select the services to track.org.osgi.framework.InvalidSyntaxException - If the tracker syntax is not correct (in the filter especially).protected void trackService(String className, String filter) throws org.osgi.framework.InvalidSyntaxException
org.osgi.framework.InvalidSyntaxExceptionprotected <T> T getTrackedService(Class<T> clazz)
doStart().T - The service type.clazz - The service interface to get.protected <T> org.osgi.framework.ServiceReference<T> getTrackedServiceRef(Class<T> clazz)
protected void registerMBean(Object mbean, String type)
doStart().mbean - The MBean to register.type - The MBean type to register.protected void registerMBeanWithName(Object mbean, String name)
doStart().mbean - The MBean to register.name - The MBean name.protected <T> void register(Class<T> clazz, T service)
doStart().T - The service type.clazz - The service interface to register.service - The actual service instance to register.protected <T> void register(Class<T> clazz, T service, Dictionary<String,?> props)
doStart().T - The service type.clazz - The service interface to register.service - The actual service instance to register.props - The service properties to register.protected void register(Class[] clazz, Object service)
doStart().clazz - The service interfaces to register.service - The actual service instance to register.protected void register(Class[] clazz, Object service, Dictionary<String,?> props)
doStart().clazz - The service interfaces to register.service - The actual service instance to register.props - The service properties to register.public Thread newThread(Runnable r)
newThread in interface ThreadFactoryCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.