Service Activator Toolkit
Version 1.0.0

org.eclipse.soda.sat.core.framework
Class ManagedServiceFactoryBundleActivator

java.lang.Object
  extended byorg.eclipse.soda.sat.core.framework.BaseBundleActivator
      extended byorg.eclipse.soda.sat.core.framework.ManagedServiceFactoryBundleActivator
All Implemented Interfaces:
BundleActivator, ManagedServiceFactory

public abstract class ManagedServiceFactoryBundleActivator
extends BaseBundleActivator
implements ManagedServiceFactory

ManagedServiceFactoryBundleActivator.java


Field Summary
 
Fields inherited from class org.eclipse.soda.sat.core.framework.BaseBundleActivator
NO_SERVICES
 
Constructor Summary
ManagedServiceFactoryBundleActivator()
           
 
Method Summary
protected  void activate()
          Hook API: This method is overridden by subclasses that wish to execute domain specific activation.
protected abstract  IManagedServiceFactoryAdvisor createAdvisor()
          Create the IManagedServiceFactoryAdvisor that knows how to create and destroy the exported service that is managed by the service factory.
protected  String createDefaultPid()
          Create the default PID for the ManagedServiceFactory.
protected  String createPid()
          Create the PID for the ManagedServiceFactory.
protected  void deactivate()
          Hook API: You have been deactivated.
 void deleted(String pid)
           
 Map getAllObjects()
          Get all the objects created for this ManagedServiceFactory.
 Iterator getAllPids()
          Get all the persistent IDs for this ManagedServiceFactory.
 Map getAllProperties()
          Get the properties of all the objects create for this ManagedServiceFactory.
protected  String getManagedServiceFactoryServiceName()
          Get the service name used to register the ManagedServiceFactory with the OSGi framework.
 String getName()
           
protected  String getPid()
          Get the persistent ID for the ManagedServiceFactory.
protected  boolean isProxyService()
          Query whether the managed service factory is created as a proxy service.
 void printFactoryConfigurationsOn(StringBuffer buffer)
          Print a description of the factory configurations on the specified buffer.
 void updated(String pid, Dictionary properties)
           
 
Methods inherited from class org.eclipse.soda.sat.core.framework.BaseBundleActivator
acquireImportedServices, acquireOptionalImportedServices, addExportedProxyService, addExportedProxyServices, addExportedService, addExportedServices, addImportedServiceFilter, addOptionalImportedServiceFilter, getAsyncStartPriority, getBundle, getBundleContext, getBundleSymbolicName, getDataDirectory, getDataFile, getExportedService, getExportedServiceNamesFromManifest, getExportedServiceProperties, getExportedServiceProperties, getExportedServices, getFilePropertiesInputStream, getFilePropertiesInputStream, getImportedService, getImportedServiceFilter, getImportedServiceNames, getImportedServiceNamesFromManifest, getImportedServiceProperty, getImportedServicePropertyKeys, getOptionalImportedService, getOptionalImportedServiceNames, getProperties, getPropertiesInputStream, getProperty, getResourcePropertiesInputStream, getResourcePropertiesInputStream, handleAcquiredOptionalImportedService, handleException, handleFailedToFindProperties, handleReleasedOptionalImportedService, isStartAsync, isTransient, isUninstallable, releaseImportedServices, releaseOptionalImportedServices, removeExportedService, removeExportedService, removeExportedServices, removeImportedServiceFilter, removeOptionalImportedServiceFilter, restartFramework, setExportedServiceProperties, setExportedServiceProperties, shutdownFramework, start, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedServiceFactoryBundleActivator

public ManagedServiceFactoryBundleActivator()
Method Detail

activate

protected void activate()
Description copied from class: BaseBundleActivator
Hook API: This method is overridden by subclasses that wish to execute domain specific activation. For example:
 protected void activate() {
     MyDomainObject object = (MyDomainObject) getExportedService(MyService.SERVICE_NAME);
     object.startup();
 }
 

Overrides:
activate in class BaseBundleActivator
See Also:
BaseBundleActivator.activate()

createAdvisor

protected abstract IManagedServiceFactoryAdvisor createAdvisor()
Create the IManagedServiceFactoryAdvisor that knows how to create and destroy the exported service that is managed by the service factory.

Returns:
An IManagedServiceFactoryAdvisor.

createDefaultPid

protected final String createDefaultPid()
Create the default PID for the ManagedServiceFactory.

Returns:
The default PID of the ManagedServiceFactory.

createPid

protected String createPid()
Create the PID for the ManagedServiceFactory.

Returns:
The PID of the ManagedServiceFactory.

deactivate

protected void deactivate()
Description copied from class: BaseBundleActivator
Hook API: You have been deactivated. Concrete subclasses sometimes override this method to execute domain specific deactivation. For example:
 protected void deactivate() {
     MyDomainObject object = (MyDomainObject) getExportedService(MyService.SERVICE_NAME);
     object.shutdown();
 }
 

Overrides:
deactivate in class BaseBundleActivator
See Also:
BaseBundleActivator.deactivate()

deleted

public final void deleted(String pid)
Specified by:
deleted in interface ManagedServiceFactory
See Also:
ManagedServiceFactory.deleted(java.lang.String)

getAllObjects

public Map getAllObjects()
Get all the objects created for this ManagedServiceFactory.

Returns:
A map of the objects, keyed by persistent ID.

getAllPids

public Iterator getAllPids()
Get all the persistent IDs for this ManagedServiceFactory.

Returns:
An iterator on the persistent IDs.

getAllProperties

public Map getAllProperties()
Get the properties of all the objects create for this ManagedServiceFactory.

Returns:
A map of the objects' properties, keyed by persistent ID.

getManagedServiceFactoryServiceName

protected final String getManagedServiceFactoryServiceName()
Get the service name used to register the ManagedServiceFactory with the OSGi framework. Per the OSGi specification, this must be the full qualified name of the ManagedServiceFactory type.

Returns:
String

getName

public String getName()
Specified by:
getName in interface ManagedServiceFactory
See Also:
ManagedServiceFactory.getName()

getPid

protected final String getPid()
Get the persistent ID for the ManagedServiceFactory.

Returns:
The pid.

isProxyService

protected boolean isProxyService()
Query whether the managed service factory is created as a proxy service.

Returns:
True if the managed service factory is created as a proxy service otherwise false.

printFactoryConfigurationsOn

public void printFactoryConfigurationsOn(StringBuffer buffer)
Print a description of the factory configurations on the specified buffer. This API is provided for debug purposes.

Parameters:
buffer - The buffer on which to print the factory configurations.

updated

public final void updated(String pid,
                          Dictionary properties)
                   throws ConfigurationException
Specified by:
updated in interface ManagedServiceFactory
Throws:
ConfigurationException
See Also:
ManagedServiceFactory.updated(java.lang.String, java.util.Dictionary)

Service Activator Toolkit
Version 1.0.0