|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.dm.DependencyActivatorBase
public abstract class DependencyActivatorBase
Base bundle activator class. Subclass this activator if you want to use dependency
management in your bundle. There are two methods you should implement:
init()
and destroy()
. Both methods take two arguments,
the bundle context and the dependency manager. The dependency manager can be used
to define all the dependencies.
Constructor Summary | |
---|---|
DependencyActivatorBase()
|
Method Summary | |
---|---|
Component |
createAdapterService(Class serviceInterface,
String serviceFilter)
Creates a new adapter service. |
Component |
createAspectService(Class serviceInterface,
String serviceFilter,
int ranking,
String attributeName)
Creates a new aspect service. |
Component |
createBundleAdapterService(int bundleStateMask,
String bundleFilter,
boolean propagate)
Creates a new bundle adapter service. |
BundleDependency |
createBundleDependency()
Creates a new bundle dependency. |
Component |
createComponent()
Creates a new component. |
ConfigurationDependency |
createConfigurationDependency()
Creates a new configuration dependency. |
Component |
createFactoryConfigurationAdapterService(String factoryPid,
String update,
boolean propagate)
Creates a new factory configuration adapter service. |
Component |
createFactoryConfigurationAdapterService(String factoryPid,
String update,
boolean propagate,
String heading,
String desc,
String localization,
PropertyMetaData[] propertiesMetaData)
Creates a new factory configuration adapter service. |
PropertyMetaData |
createPropertyMetaData()
Creates a new configuration property metadata. |
Component |
createResourceAdapter(String resourceFilter,
boolean propagate,
Object callbackInstance,
String callbackChanged)
Creates a new resource adapter service. |
Component |
createResourceAdapter(String resourceFilter,
Object propagateCallbackInstance,
String propagateCallbackMethod,
Object callbackInstance,
String callbackChanged)
Creates a new resource adapter service. |
ResourceDependency |
createResourceDependency()
Creates a new resource dependency. |
ServiceDependency |
createServiceDependency()
Creates a new service dependency. |
TemporalServiceDependency |
createTemporalServiceDependency()
Creates a new temporal service dependency. |
abstract void |
destroy(BundleContext context,
DependencyManager manager)
Destroy the dependency manager. |
BundleContext |
getBundleContext()
Returns the bundle context that is associated with this bundle. |
DependencyManager |
getDependencyManager()
Returns the dependency manager that is associated with this bundle. |
Logger |
getLogger()
Returns the logger that is associated with this bundle. |
abstract void |
init(BundleContext context,
DependencyManager manager)
Initialize the dependency manager. |
void |
start(BundleContext context)
Start method of the bundle activator. |
void |
stop(BundleContext context)
Stop method of the bundle activator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DependencyActivatorBase()
Method Detail |
---|
public abstract void init(BundleContext context, DependencyManager manager) throws Exception
start()
method of the
bundle activator, causing the bundle not to start.
context
- the bundle contextmanager
- the dependency manager
Exception
- if the initialization failspublic abstract void destroy(BundleContext context, DependencyManager manager) throws Exception
If something goes wrong and you do not want your bundle to be stopped, you can throw an
exception. This exception will be passed on to the stop()
method of the
bundle activator, causing the bundle not to stop.
context
- the bundle contextmanager
- the dependency manager
Exception
- if the destruction failspublic void start(BundleContext context) throws Exception
init()
.
start
in interface BundleActivator
context
- the bundle context
Exception
public void stop(BundleContext context) throws Exception
destroy()
method
and cleans up all left over dependencies.
stop
in interface BundleActivator
context
- the bundle context
Exception
public BundleContext getBundleContext()
public DependencyManager getDependencyManager()
public Logger getLogger()
public Component createComponent()
public ServiceDependency createServiceDependency()
public TemporalServiceDependency createTemporalServiceDependency()
timeout
- the max number of milliseconds to wait for a service availability.
public ConfigurationDependency createConfigurationDependency()
public PropertyMetaData createPropertyMetaData()
public BundleDependency createBundleDependency()
public ResourceDependency createResourceDependency()
public Component createAspectService(Class serviceInterface, String serviceFilter, int ranking, String attributeName)
public Component createAdapterService(Class serviceInterface, String serviceFilter)
public Component createResourceAdapter(String resourceFilter, boolean propagate, Object callbackInstance, String callbackChanged)
public Component createResourceAdapter(String resourceFilter, Object propagateCallbackInstance, String propagateCallbackMethod, Object callbackInstance, String callbackChanged)
public Component createBundleAdapterService(int bundleStateMask, String bundleFilter, boolean propagate)
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate)
public Component createFactoryConfigurationAdapterService(String factoryPid, String update, boolean propagate, String heading, String desc, String localization, PropertyMetaData[] propertiesMetaData)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |