org.apache.felix.servicebinder
Class GenericActivator

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

public abstract class GenericActivator
extends Object
implements 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  BundleContext getBundleContext()
          Returns the BundleContext
protected  List getInstanceReferences()
          Returns the list of instance references currently associated to this activator
protected  Object proxyProvidedServiceObject(Object obj, InstanceMetadata descriptor)
          Method called before an object implementing services is registered in the OSGi framework.
protected  Object proxyRequiredServiceObject(Object obj, DependencyMetadata descriptor)
          Method called before the binding of the service object occurs.
 void start(BundleContext context)
          Called upon starting of the bundle.
 void stop(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(BundleContext context)
           throws 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 BundleActivator
Parameters:
context - The bundle context passed by the framework
Throws:
Exception - any exception thrown from initialize

stop

public void stop(BundleContext context)
          throws Exception
Stop method that destroys all the instance managers

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

getInstanceReferences

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

Returns:
the list of instance references

getBundleContext

protected BundleContext getBundleContext()
Returns the BundleContext

Returns:
the BundleContext

proxyProvidedServiceObject

protected Object proxyProvidedServiceObject(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 Object proxyRequiredServiceObject(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


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