org.apache.felix.dm.runtime
Class Activator

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

public class Activator
extends DependencyActivatorBase


Constructor Summary
Activator()
           
 
Method Summary
 void destroy(BundleContext context, DependencyManager dm)
          Our bundle is stopping: shutdown our Dependency Manager Runtime service.
 void init(BundleContext context, DependencyManager dm)
          Initialize our DependencyManager Runtime service.
 
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 dm)
          throws Exception
Initialize our DependencyManager Runtime service. We depend on the OSGi LogService, and we track all started bundles which do have a "DependencyManager-Component" Manifest header. If the "dm.runtime.log=true" parameter is configured in the Felix config.properties then we'll use a required/temporal service dependency over the log service. This temporal dependency avoids us to be restarted if the log service is temporarily unavailable (that is: when the log service is updating). if the "dm.runtime.log" is not configured or it it is set to false, then we'll use an optional dependency over the log service, in order to use a NullObject in case the log service is not available.

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

destroy

public void destroy(BundleContext context,
                    DependencyManager dm)
             throws Exception
Our bundle is stopping: shutdown our Dependency Manager Runtime service.

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.