|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cytoscape.service.util.AbstractCyActivator
public abstract class AbstractCyActivator
A simple BundleActivator with convenience methods for registering OSGi services and either getting references to single services or registering interest in all services of a specified type. Users should extend this class and implement the start(BundleContext bc) method.
Constructor Summary | |
---|---|
AbstractCyActivator()
Constructor. |
Method Summary | ||
---|---|---|
protected
|
getService(org.osgi.framework.BundleContext bc,
Class<S> serviceClass)
A method that attempts to get a service of the specified type. |
|
protected
|
getService(org.osgi.framework.BundleContext bc,
Class<S> serviceClass,
String filter)
A method that attempts to get a service of the specified type and that passes the specified filter. |
|
protected void |
registerAllServices(org.osgi.framework.BundleContext bc,
Object service,
Properties props)
A utility method that registers the specified service object as an OSGi service for all interfaces that the object implements. |
|
protected void |
registerService(org.osgi.framework.BundleContext bc,
Object service,
Class<?> serviceClass,
Properties props)
A utility method that registers the specified service object as an OSGi service of the specified type. |
|
protected void |
registerServiceListener(org.osgi.framework.BundleContext bc,
Object listener,
String registerMethodName,
String unregisterMethodName,
Class<?> serviceClass)
A method that will cause the specified register/unregister methods on the listener object to be called any time that a service of the specified type is registered or unregistered. |
|
protected void |
registerServiceListener(org.osgi.framework.BundleContext bc,
Object listener,
String registerMethodName,
String unregisterMethodName,
Class<?> serviceClass,
Class<?> methodClass)
A method that will cause the specified register/unregister methods on the listener object to be called any time that a service of the specified type is registered or unregistered. |
|
protected void |
registerServiceListener(org.osgi.framework.BundleContext bc,
Object listener,
String registerMethodName,
String unregisterMethodName,
Class<?> serviceClass,
Class<?> methodClass,
String additionalFilter)
A method that will cause the specified register/unregister methods on the listener object to be called any time that a service of the specified type is registered or unregistered. |
|
protected void |
registerServiceListener(org.osgi.framework.BundleContext bc,
Object listener,
String registerMethodName,
String unregisterMethodName,
Class<?> serviceClass,
String additionalFilter)
A method that will cause the specified register/unregister methods on the listener object to be called any time that a service of the specified type is registered or unregistered. |
|
void |
stop(org.osgi.framework.BundleContext bc)
A default implementation of the BundleActivator.stop() method that cleans up any services registered, services gotten, or services being listened for as determined by calls to the utility methods provided by this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.osgi.framework.BundleActivator |
---|
start |
Constructor Detail |
---|
public AbstractCyActivator()
Method Detail |
---|
public final void stop(org.osgi.framework.BundleContext bc)
stop
in interface org.osgi.framework.BundleActivator
protected final <S> S getService(org.osgi.framework.BundleContext bc, Class<S> serviceClass)
S
- The generic type of the class defining the type of service desired.bc
- The BundleContext used to find services.serviceClass
- The class defining the type of service desired.
RuntimeException
- If the requested service can't be found.protected final <S> S getService(org.osgi.framework.BundleContext bc, Class<S> serviceClass, String filter)
S
- The generic type of the class defining the type of service desired.bc
- The BundleContext used to find services.serviceClass
- The class defining the type of service desired.filter
- The string defining the filter the service must pass. See OSGi's
service filtering syntax for more detail.
RuntimeException
- If the requested service can't be found.protected final void registerServiceListener(org.osgi.framework.BundleContext bc, Object listener, String registerMethodName, String unregisterMethodName, Class<?> serviceClass, Class<?> methodClass, String additionalFilter)
bc
- The BundleContext used to find services.listener
- Your object listening for service registrations.registerMethodName
- The name of the method to be called when a service is registered.unregisterMethodName
- The name of the method to be called when a service is unregistered.serviceClass
- The class defining the type of service desired.methodClass
- There are situations where, because of the use of generics and type
erasure that the serviceClass is a subclass of the class used by the registration method,
in which case, this extra argument allows that class to be specified.additionalFilter
- An additional filter to be applied to the OSGi servicesprotected final void registerServiceListener(org.osgi.framework.BundleContext bc, Object listener, String registerMethodName, String unregisterMethodName, Class<?> serviceClass)
bc
- The BundleContext used to find services.listener
- Your object listening for service registrations.registerMethodName
- The name of the method to be called when a service is registered.unregisterMethodName
- The name of the method to be called when a service is unregistered.serviceClass
- The class defining the type of service desired.protected final void registerServiceListener(org.osgi.framework.BundleContext bc, Object listener, String registerMethodName, String unregisterMethodName, Class<?> serviceClass, String additionalFilter)
bc
- The BundleContext used to find services.listener
- Your object listening for service registrations.registerMethodName
- The name of the method to be called when a service is registered.unregisterMethodName
- The name of the method to be called when a service is unregistered.serviceClass
- The class defining the type of service desired.additionalFilter
- An additional filter to be applied to the OSGi servicesprotected final void registerServiceListener(org.osgi.framework.BundleContext bc, Object listener, String registerMethodName, String unregisterMethodName, Class<?> serviceClass, Class<?> methodClass)
bc
- The BundleContext used to find services.listener
- Your object listening for service registrations.registerMethodName
- The name of the method to be called when a service is registered.unregisterMethodName
- The name of the method to be called when a service is unregistered.serviceClass
- The class defining the type of service desired.methodClass
- There are situations where, because of the use of generics and type
erasure that the serviceClass is a subclass of the class used by the registration method,
in which case, this extra argument allows that class to be specified.protected final void registerAllServices(org.osgi.framework.BundleContext bc, Object service, Properties props)
bc
- The BundleContext used to find services.service
- The object to be registered as one or more services.props
- The service properties to be registered with each service.protected final void registerService(org.osgi.framework.BundleContext bc, Object service, Class<?> serviceClass, Properties props)
bc
- The BundleContext used to find services.service
- The object to be registered as one or more services.serviceClass
- The class defining the type of service to be registered.props
- The service properties to be registered with each service.
|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |