When developing an OSGi bundle that has dependencies and possibly registers services, there are two classes in particular we need to implement:
When using the dependency manager, your bundle activator is a subclass of DependencyActivatorBase. It needs to implement two life cycle methods: init and destroy. Both methods take two arguments: BundleContext and DependencyManager. The latter is your interface to the declarative API you can use to define your services and dependencies.
The following paragraphs will show various examples that explain how to do this. Subsequently, some more advanced scenarios will be covered that involve listening to dependency and service state changes and interacting with the OSGi framework from within your service implementation.
public class Activator extends DependencyActivatorBase {
// TODO :)
}
|