org.apache.felix.servicebinder
Class GenericActivator

java.lang.Object
  extended by org.apache.felix.servicebinder.GenericActivator
All Implemented Interfaces:
org.osgi.framework.BundleActivator
Direct Known Subclasses:
Activator

public abstract class GenericActivator
extends java.lang.Object
implements org.osgi.framework.BundleActivator

The GenericActivator, it will read information from the metadata.xml file and will create the corresponding instance managers

Author:
Felix Project Team

Constructor Summary
GenericActivator()
           
 
Method Summary
protected  org.osgi.framework.BundleContext getBundleContext()
          Returns the BundleContext
protected  java.util.List getInstanceReferences()
          Returns the list of instance references currently associated to this activator
protected  java.lang.Object proxyProvidedServiceObject(java.lang.Object obj, InstanceMetadata descriptor)
          Method called before an object implementing services is registered in the OSGi framework.
protected  java.lang.Object proxyRequiredServiceObject(java.lang.Object obj, DependencyMetadata descriptor)
          Method called before the binding of the service object occurs.
 void start(org.osgi.framework.BundleContext context)
          Called upon starting of the bundle.
 void stop(org.osgi.framework.BundleContext context)
          Stop method that destroys all the instance managers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericActivator

public GenericActivator()
Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Called upon starting of the bundle. This method invokes initialize() which parses the meta data and creates the instance managers

Specified by:
start in interface org.osgi.framework.BundleActivator
Parameters:
context - The bundle context passed by the framework
Throws:
java.lang.Exception - any exception thrown from initialize

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Stop method that destroys all the instance managers

Specified by:
stop in interface org.osgi.framework.BundleActivator
Parameters:
context - The Bundle Context passed by the framework
Throws:
java.lang.Exception - any exception thrown during destruction of the instance managers

getInstanceReferences

protected java.util.List getInstanceReferences()
Returns the list of instance references currently associated to this activator

Returns:
the list of instance references

getBundleContext

protected org.osgi.framework.BundleContext getBundleContext()
Returns the BundleContext

Returns:
the BundleContext

proxyProvidedServiceObject

protected java.lang.Object proxyProvidedServiceObject(java.lang.Object obj,
                                                      InstanceMetadata descriptor)
Method called before an object implementing services is registered in the OSGi framework. This method is provided so that subclasses of the generic activator may proxy the object. The default implementation returns the passed in object.

Parameters:
obj - the instance object
descriptor - the instance descriptor that provides information relevant to the instance object

proxyRequiredServiceObject

protected java.lang.Object proxyRequiredServiceObject(java.lang.Object obj,
                                                      DependencyMetadata descriptor)
Method called before the binding of the service object occurs. This method is provided so that subclasses of the generic activator may proxy the object. The default implementation returns the passed in object.

Parameters:
obj - the instance object
descriptor - the dependency descriptor that provides information relevant to the service object