Service Activator Toolkit
Version 1.0.0

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

java.lang.Object
  extended byorg.eclipse.soda.sat.core.framework.BaseManagedServiceFactoryAdvisor
All Implemented Interfaces:
IManagedServiceFactoryAdvisor

public abstract class BaseManagedServiceFactoryAdvisor
extends Object
implements IManagedServiceFactoryAdvisor

BaseManagedServiceFactoryAdvisor is an abstract class from which bundles typically derive their IManagedServiceFactoryAdvisor.

This class provides reasonable defaults and no-op implementations of optional methods from IManagedServiceFactoryAdvisor, making it easier to create an advisor.


Field Summary
protected static String[] NO_SERVICES
           
 
Constructor Summary
BaseManagedServiceFactoryAdvisor()
           
 
Method Summary
 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.
 void validateConfiguration(String pid, Dictionary properties)
          Validate the configuration, throwing a ConfigurationException if the configuration is deemed to be invalid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.sat.core.framework.interfaces.IManagedServiceFactoryAdvisor
create, update
 

Field Detail

NO_SERVICES

protected static final String[] NO_SERVICES
Constructor Detail

BaseManagedServiceFactoryAdvisor

public BaseManagedServiceFactoryAdvisor()
Method Detail

createImportedServiceFilters

public void createImportedServiceFilters(String pid,
                                         Dictionary oldProperties,
                                         Dictionary properties,
                                         IBundleActivationManager manager)
Description copied from interface: IManagedServiceFactoryAdvisor
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.

Specified by:
createImportedServiceFilters in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.createImportedServiceFilters(java.lang.String, java.util.Dictionary, java.util.Dictionary, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

destroy

public void destroy(String pid,
                    Object object,
                    Dictionary properties,
                    IBundleActivationManager manager)
Description copied from interface: IManagedServiceFactoryAdvisor
Destroy the specified object with the specified persistent ID.

Specified by:
destroy in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.destroy(java.lang.String, java.lang.Object, java.util.Dictionary, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

getImportedServiceNames

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

Specified by:
getImportedServiceNames in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.getImportedServiceNames(java.lang.String, java.util.Dictionary, java.util.Dictionary, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

getOptionalImportedServiceNames

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

Specified by:
getOptionalImportedServiceNames in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.getOptionalImportedServiceNames(java.lang.String, java.util.Dictionary, java.util.Dictionary, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

handleAcquiredOptionalImportedService

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

Specified by:
handleAcquiredOptionalImportedService in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.handleAcquiredOptionalImportedService(java.lang.String, java.lang.Object, java.lang.String, java.lang.Object, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

handleReleasedOptionalImportedService

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

Specified by:
handleReleasedOptionalImportedService in interface IManagedServiceFactoryAdvisor
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.
See Also:
IManagedServiceFactoryAdvisor.handleReleasedOptionalImportedService(java.lang.String, java.lang.Object, java.lang.String, java.lang.Object, org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManager)

validateConfiguration

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

Specified by:
validateConfiguration in interface IManagedServiceFactoryAdvisor
Parameters:
pid - The unique persistent ID for the configuration.
properties - The properties for the configuration.
Throws:
ConfigurationException
See Also:
IManagedServiceFactoryAdvisor.validateConfiguration(java.lang.String, java.util.Dictionary)

Service Activator Toolkit
Version 1.0.0