samples.dependonservice
Class Activator

java.lang.Object
  extended by org.apache.felix.dm.DependencyActivatorBase
      extended by samples.dependonservice.Activator
All Implemented Interfaces:
BundleActivator

public class Activator
extends DependencyActivatorBase


Constructor Summary
Activator()
           
 
Method Summary
 void destroy(BundleContext context, DependencyManager manager)
          Destroy the dependency manager.
 void init(BundleContext context, DependencyManager manager)
          Initialize the dependency manager.
 
Methods inherited from class org.apache.felix.dm.DependencyActivatorBase
createAdapterService, createAspectService, createBundleAdapterService, createBundleDependency, createComponent, createConfigurationDependency, createFactoryConfigurationAdapterService, createFactoryConfigurationAdapterService, createPropertyMetaData, createResourceAdapter, createResourceAdapter, createResourceDependency, createServiceDependency, createTemporalServiceDependency, getBundleContext, getDependencyManager, getLogger, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Activator

public Activator()
Method Detail

init

public void init(BundleContext context,
                 DependencyManager manager)
          throws Exception
Description copied from class: DependencyActivatorBase
Initialize the dependency manager. Here you can add all components and their dependencies. If something goes wrong and you do not want your bundle to be started, you can throw an exception. This exception will be passed on to the start() method of the bundle activator, causing the bundle not to start.

Specified by:
init in class DependencyActivatorBase
Parameters:
context - the bundle context
manager - the dependency manager
Throws:
Exception - if the initialization fails

destroy

public void destroy(BundleContext context,
                    DependencyManager manager)
             throws Exception
Description copied from class: DependencyActivatorBase
Destroy the dependency manager. Here you can remove all components and their dependencies. Actually, the base class will clean up your dependencies anyway, so most of the time you don't need to do anything here.

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.

Specified by:
destroy in class DependencyActivatorBase
Parameters:
context - the bundle context
manager - the dependency manager
Throws:
Exception - if the destruction fails


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.