com.sas.services
Class AbstractServiceFactory

java.lang.Object
  |
  +--com.sas.services.AbstractServiceFactory
All Implemented Interfaces:
ServiceFactoryInterface
Direct Known Subclasses:
AuthenticationServiceFactory, DiscoveryServiceFactory, EventBrokerDiscoveryServiceFactory, EventBrokerServiceFactory, InformationServiceFactory, SessionServiceFactory, StoredProcessServiceFactory, UserServiceFactory

public abstract class AbstractServiceFactory
extends Object
implements ServiceFactoryInterface

An abstract service factory class which provides a concrete implementation of getDependentServiceInterfaces() that specifies no service dependencies. This method should be overridden if a service manufactured by the factory depends upon other services being available.

Since:
1.1

Constructor Summary
protected AbstractServiceFactory()
          Constructs a default instance.
protected AbstractServiceFactory(ServiceComponentConfigInterface serviceComponentConfiguration)
          Constructs an instance specifying the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.
 
Method Summary
 String[] getDependentServiceInterfaces()
          Gets an array of strings representing the Java interfaces of service(s) which must be available at the time this factory's getService(ServiceConfigurationInterface) method is invoked.
abstract  RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration)
          Gets a service initialized with the specified service configuration.
 ServiceComponentConfigInterface getServiceComponentConfiguration()
          Gets the service component's configuration.
protected  void mergeServiceConfiguration(ServiceComponent serviceComponent, Node serviceConfigurationToAdd)
          Merges the service configuration.
 void updateServiceConfiguration(ServiceComponent serviceComponent, Node serviceConfigurationToAdd)
          Updates the service's configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServiceFactory

protected AbstractServiceFactory()
Constructs a default instance.

Use this constructor if the service manufactured by the service factory does not permit is configuration to be updated in an additive manner and does not return a singleton service.

Use AbstractServiceFactory(ServiceComponentConfigInterface serviceComponentConfiguration) to construct an instance specifying whether or not the service's configuration may be updated in an additive manner.


AbstractServiceFactory

protected AbstractServiceFactory(ServiceComponentConfigInterface serviceComponentConfiguration)
Constructs an instance specifying the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.

Use AbstractServiceFactory() to construct an instance of a factory which manufactures a service whose configuration may not be updated in an additive manner.

Parameters:
serviceComponentConfiguration - The service component's configuration.
Method Detail

getService

public abstract RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration)
                                           throws ServiceException
Gets a service initialized with the specified service configuration.
Specified by:
getService in interface ServiceFactoryInterface
Parameters:
serviceConfiguration - Configuration to be used to initialize the service.
Returns:
Service initialized with the specified configuration.
Throws:
ServiceException - if unable to obtain the service.

getDependentServiceInterfaces

public String[] getDependentServiceInterfaces()
Gets an array of strings representing the Java interfaces of service(s) which must be available at the time this factory's getService(ServiceConfigurationInterface) method is invoked. This abstract factory does not specify any service dependencies so a zero length array is returned. Override this default method implementation if there are 1..* service dependencies.
Specified by:
getDependentServiceInterfaces in interface ServiceFactoryInterface
Returns:
Array of 0..* Java interfaces implemented by services that must be available at the time the service factory is asked to get a service. For example, if the user service depends upon a logging service, then the user service would return "com.sas.services.logging.LoggingServiceInterface". If there are no dependencies upon any other services then a zero length array should be returned.

updateServiceConfiguration

public void updateServiceConfiguration(ServiceComponent serviceComponent,
                                       Node serviceConfigurationToAdd)
                                throws ServiceException
Updates the service's configuration.
Parameters:
serviceComponent - The service component whose configuration is to be updated by adding the accompanying configuration.
serviceConfigurationToAdd - The configuration to be added to the service's current configuration.
Throws:
ServiceException - if unable to update the service's configuration.
IllegalArgumentException - if a null service component or configuration is specified.

mergeServiceConfiguration

protected void mergeServiceConfiguration(ServiceComponent serviceComponent,
                                         Node serviceConfigurationToAdd)
                                  throws ServiceException
Merges the service configuration.
Parameters:
serviceComponent - The service whose configuration is to be updated by merging the specified configuration.
serviceConfigurationToAdd - The service configuration which is to be merged into the service's current configuration. Note that this configuration must not conflict with the current configuration or a ServiceException will be thrown to indicate that the merge request was rejected.
Throws:
ServiceException -  

getServiceComponentConfiguration

public final ServiceComponentConfigInterface getServiceComponentConfiguration()
Gets the service component's configuration.
Specified by:
getServiceComponentConfiguration in interface ServiceFactoryInterface
Returns:
Service component's configuration or null if a configuration is not defined.




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:52