org.apache.felix.transaction.internal
Class Activator

java.lang.Object
  extended by org.apache.felix.transaction.internal.Activator
All Implemented Interfaces:
BundleActivator, ManagedServiceFactory

public class Activator
extends Object
implements BundleActivator, ManagedServiceFactory


Constructor Summary
Activator()
           
 
Method Summary
 void deleted(String pid)
          Remove a factory instance.
 String getName()
          Return a descriptive name of this factory.
 void start(BundleContext bundleContext)
          Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start this bundle.
 void stop(BundleContext context)
          Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle.
 void updated(String pid, Dictionary properties)
          Create a new instance, or update the configuration of an existing instance.
 
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

start

public void start(BundleContext bundleContext)
           throws Exception
Description copied from interface: BundleActivator
Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start this bundle. This method can be used to register services or to allocate any resources that this bundle needs.

This method must complete and return to its caller in a timely manner.

Specified by:
start in interface BundleActivator
Parameters:
bundleContext - The execution context of the bundle being started.
Throws:
Exception - If this method throws an exception, this bundle is marked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.

stop

public void stop(BundleContext context)
          throws Exception
Description copied from interface: BundleActivator
Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary to stop the bundle. In general, this method should undo the work that the BundleActivator.start method started. There should be no active threads that were started by this bundle when this bundle returns. A stopped bundle must not call any Framework objects.

This method must complete and return to its caller in a timely manner.

Specified by:
stop in interface BundleActivator
Parameters:
context - The execution context of the bundle being stopped.
Throws:
Exception - If this method throws an exception, the bundle is still marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.

getName

public String getName()
Description copied from interface: ManagedServiceFactory
Return a descriptive name of this factory.

Specified by:
getName in interface ManagedServiceFactory
Returns:
the name for the factory, which might be localized

updated

public void updated(String pid,
                    Dictionary properties)
             throws ConfigurationException
Description copied from interface: ManagedServiceFactory
Create a new instance, or update the configuration of an existing instance. If the PID of the Configuration object is new for the Managed Service Factory, then create a new factory instance, using the configuration properties provided. Else, update the service instance with the provided properties.

If the factory instance is registered with the Framework, then the configuration properties should be copied to its registry properties. This is not mandatory and security sensitive properties should obviously not be copied.

If this method throws any Exception, the Configuration Admin service must catch it and should log it.

When the implementation of updated detects any kind of error in the configuration properties, it should create a new ConfigurationException which describes the problem.

The Configuration Admin service must call this method asynchronously. This implies that implementors of the ManagedServiceFactory class can be assured that the callback will not take place during registration when they execute the registration in a synchronized method.

Specified by:
updated in interface ManagedServiceFactory
Parameters:
pid - The PID for this configuration.
properties - A copy of the configuration properties. This argument must not contain the service.bundleLocation" property. The value of this property may be obtained from the Configuration.getBundleLocation method.
Throws:
ConfigurationException - when the configuration properties are invalid.

deleted

public void deleted(String pid)
Description copied from interface: ManagedServiceFactory
Remove a factory instance. Remove the factory instance associated with the PID. If the instance was registered with the service registry, it should be unregistered.

If this method throws any Exception, the Configuration Admin service must catch it and should log it.

The Configuration Admin service must call this method asynchronously.

Specified by:
deleted in interface ManagedServiceFactory
Parameters:
pid - the PID of the service to be removed


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