Service Activator Toolkit
Version 1.1.0 (20081206)

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

All Known Implementing Classes:
BaseManagedServiceAdvisor

public interface IManagedServiceAdvisor

The IManagedServiceAdvisor interface defines the API for an object that knows how to create, destroy and update an object for a ManagedService.


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

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 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

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 persistent id for the configuration.
oldProperties - The old properties for the configuration.
properties - The properties for the configuration.
manager - The configurations's IBundleActivationManager.

destroy

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

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

getImportedServiceNames

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 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

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 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

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 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

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 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

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 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

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 persistent id for the configuration.
properties - The properties for the configuration.
Throws:
ConfigurationException

Service Activator Toolkit
Version 1.1.0 (20081206)