Service Activator Toolkit
Version 1.0.0

org.eclipse.soda.sat.core.framework.interfaces
Interface IManagedServiceFactoryAdvisor

All Known Implementing Classes:
BaseManagedServiceFactoryAdvisor

public interface IManagedServiceFactoryAdvisor

The IManagedServiceFactoryAdvisor interface defines the API for an object that knows how to create, destroy and update objects for a ManagedServiceFactory. APIs are also defined for getting the registered name of the ManagedServiceFactory, as well as handling the case where all imported service are not required before an object can be created, and the handling of acquired and released services for such an object.


Method Summary
 Object create(String pid, Dictionary properties, IBundleActivationManager manager)
          Create and return an object for the configuration with the specified persistent ID using the specified properties.
 void createImportedServiceFilters(String pid, Dictionary oldProperties, Dictionary properties, IBundleActivationManager manager)
          Create the imported service filters for the configuration with the specified persistent ID and properties.
 void destroy(String pid, Object object, Dictionary properties, IBundleActivationManager manager)
          Destroy the specified object with the specified persistent ID.
 String[] getImportedServiceNames(String pid, Dictionary oldProperties, Dictionary properties, IBundleActivationManager manager)
          Get the imported service names for the configuration with the specified persistent ID.
 String[] getOptionalImportedServiceNames(String pid, Dictionary oldProperties, Dictionary properties, IBundleActivationManager manager)
          Get the optional imported service names for the configuration with the specified persistent ID.
 void handleAcquiredOptionalImportedService(String pid, Object object, String importedServiceName, Object importedService, IBundleActivationManager manager)
          This method is called when an optional imported service has been acquired.
 void handleReleasedOptionalImportedService(String pid, Object object, String importedServiceName, Object importedService, IBundleActivationManager manager)
          When all imported services are not required, this method is called when an imported service has been released.
 Object update(String pid, Object object, Dictionary oldProperties, Dictionary properties, IBundleActivationManager manager)
          Update and return an object for the configuration with the specified persistent ID using the specified properties.
 void validateConfiguration(String pid, Dictionary properties)
          Validate the configuration, throwing a ConfigurationException if the configuration is deemed to be invalid.
 

Method Detail

create

public Object create(String pid,
                     Dictionary properties,
                     IBundleActivationManager manager)
Create and return an object for the configuration with the specified persistent ID using the specified properties. The specified manager may be used to perform OSGi responsibilities, such as registering the object as an exported service.

Parameters:
pid - The unique persistent ID for the configuration.
properties - The properties for the configuration.
manager - The configurations's IBundleActivationManager.
Returns:
The object created for the configuration. If, for some reason, an object could not be created, return null.

createImportedServiceFilters

public void createImportedServiceFilters(String pid,
                                         Dictionary oldProperties,
                                         Dictionary properties,
                                         IBundleActivationManager manager)
Create the imported service filters for the configuration with the specified persistent ID and properties. The filter is an LDAP filter and must be added using the specified manager.

Parameters:
pid - The unique persistent ID for the configuration.
oldProperties - The old properties for the configuration.
properties - The properties for the configuration.
manager - The configurations's IBundleActivationManager.

destroy

public void destroy(String pid,
                    Object object,
                    Dictionary properties,
                    IBundleActivationManager manager)
Destroy the specified object with the specified persistent ID.

Parameters:
pid - The unique persistent ID for the configuration.
object - The object to destroy.
properties - The properties for the configuration.
manager - The configurations's IBundleActivationManager.

getImportedServiceNames

public String[] getImportedServiceNames(String pid,
                                        Dictionary oldProperties,
                                        Dictionary properties,
                                        IBundleActivationManager manager)
Get the imported service names for the configuration with the specified persistent ID.

Parameters:
pid - The unique persistent ID for the configuration.
oldProperties - The old configuration properties.
properties - The new configuration properties
manager - The configuration's IBundleActivationManager.
Returns:
The imported service names for the configuration.

getOptionalImportedServiceNames

public String[] getOptionalImportedServiceNames(String pid,
                                                Dictionary oldProperties,
                                                Dictionary properties,
                                                IBundleActivationManager manager)
Get the optional imported service names for the configuration with the specified persistent ID.

Parameters:
pid - The unique persistent ID for the configuration.
oldProperties - The old configuration properties.
properties - The new configuration properties
manager - The configuration's IBundleActivationManager.
Returns:
The imported service names for the configuration.

handleAcquiredOptionalImportedService

public void handleAcquiredOptionalImportedService(String pid,
                                                  Object object,
                                                  String importedServiceName,
                                                  Object importedService,
                                                  IBundleActivationManager manager)
This method is called when an optional imported service has been acquired.

Parameters:
pid - The unique persistent id for the configuration.
object - The configured object for the specified persistent ID.
importedServiceName - The fully-qualified name of the optional imported service.
importedService - The acquired optional imported service.
manager - The configuration's IBundleActivationManager.

handleReleasedOptionalImportedService

public void handleReleasedOptionalImportedService(String pid,
                                                  Object object,
                                                  String importedServiceName,
                                                  Object importedService,
                                                  IBundleActivationManager manager)
When all imported services are not required, this method is called when an imported service has been released.

Parameters:
pid - The unique persistent id for the configuration.
object - The object for the specified persistent ID.
importedServiceName - The fully-qualified name of the optional imported service.
importedService - The released optional imported service.
manager - The configurations's IBundleActivationManager.

update

public Object update(String pid,
                     Object object,
                     Dictionary oldProperties,
                     Dictionary properties,
                     IBundleActivationManager manager)
Update and return an object for the configuration with the specified persistent ID using the specified properties. The specified manager may be used to perform OSGi responsibilities, such as registering the object as an exported service.

Parameters:
pid - The unique persistent ID for the configuration.
object - The object for the specified persistent ID.
oldProperties - The old properties for the object.
properties - The properties for the object.
manager - The configurations's IBundleActivationManager.
Returns:
The created object must be returned. If, for some reason, an object could not be updated, return null.

validateConfiguration

public void validateConfiguration(String pid,
                                  Dictionary properties)
                           throws ConfigurationException
Validate the configuration, throwing a ConfigurationException if the configuration is deemed to be invalid.

Parameters:
pid - The unique persistent ID for the configuration.
properties - The properties for the configuration.
Throws:
ConfigurationException

Service Activator Toolkit
Version 1.0.0