***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.deployment
Class DeployableService

com.sas.services.deployment.DeployableService
All Implemented Interfaces:
DeployInterface, java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
RMIDeployableService

public class DeployableService
implements java.io.Serializable, java.lang.Comparable, DeployInterface

A deployable service is an object that represents a foundation service that can be deployed by the ServiceLoader utility. It represents a foundation service which is utltimately defined in terms of an Open Metadata Architecture (OMA) metadata schema.

During the process of querying a metadata source for a foundation service deployment the creation of a DeployableService represents a conversion from an OMA metadata representation into an alternative representation that is more suited for use in the foundation service deployment domain.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
protected DeployableService()
          Constructs a default instance.
protected DeployableService(java.lang.String id, ServiceConfigurationInterface serviceConfiguration)
          Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service.
  DeployableService(java.lang.String id, ServiceConfigurationInterface serviceConfiguration, java.lang.String[] dependencies)
          Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service.
 
Method Summary
 int compareTo(java.lang.Object deployableService)
          Compares two DeployableService objects to determine ordering based upon their stated service dependencies.
 RemoteServiceInterface deploy()
          Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.
 RemoteServiceInterface deploy(DiscoveryServiceInterface discoveryService)
          Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.
 boolean equals(java.lang.Object other)
          Determines whether or not the other object equals this object.
 java.util.Set getDependencies()
          Gets an iterator of the services on which this service depends.
 java.lang.String getId()
          Gets the service's metadata ID.
 ServiceConfigurationInterface getServiceConfiguration()
          Gets the service configuration.
 java.lang.String getServiceFactory()
          Gets the name of the class that will serve as the factory used to manufacture an instance of this service.
 int hashCode()
          Gets a hash code for this service attribute.
 void setDependencies(java.util.Set dependencies)
          Gets an iterator of the services on which this service depends.
 java.lang.String toString()
          Gets a string representation of this instance.
 

Constructor Detail

DeployableService

protected DeployableService()
Constructs a default instance.


DeployableService

protected DeployableService(java.lang.String id,
                            ServiceConfigurationInterface serviceConfiguration)
                     throws ServiceException
Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service. Additionally a service configuration is specified that contains data that the service will use during initialization. Optional dependencies upon other services may also be specified. These dependencies are used to ensure that this service is not instaniated until all services on which it depends have been instantiated.

Parameters:
id - Service's ID
serviceConfiguration - Deployable service's initialization configuration that will be provided to the service factory.
Throws:
ServiceException - if unable to construct an instance.

DeployableService

public DeployableService(java.lang.String id,
                         ServiceConfigurationInterface serviceConfiguration,
                         java.lang.String[] dependencies)
                  throws ServiceException
Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service. Additionally a service configuration is specified that contains data that the service will use during initialization. Optional dependencies upon other services may also be specified. These dependencies are used to ensure that this service is not instaniated until all services on which it depends have been instantiated.

Parameters:
id - Deployable service's repository ID.
serviceConfiguration - Deployable service's initialization configuration that will be provided to the service factory.
dependencies - A set of 0..* service repository IDs upon which this service depends. This service can not be deployed until these other services are deployed. A null parameter value indicates that there are no other dependencies.
Throws:
ServiceException - if unable to construct an instance.
Method Detail

getServiceConfiguration

public final ServiceConfigurationInterface getServiceConfiguration()
Gets the service configuration.

Returns:
Service configuration.

getDependencies

public final java.util.Set getDependencies()
Gets an iterator of the services on which this service depends. Each iterated element is of type String representing an ID value associated with the service.

Returns:
Iterator of service dependencies. Each iterated element will be of type String.

setDependencies

public final void setDependencies(java.util.Set dependencies)
Gets an iterator of the services on which this service depends. Each iterated element is of type String representing an ID value associated with the service.

Parameters:
dependencies - Set containing 0..* elements of type String representing a service ID on which this service depends.

getId

public final java.lang.String getId()
Gets the service's metadata ID. This is the ServiceComponent's Id attribute.

Returns:
ID.

toString

public java.lang.String toString()
Gets a string representation of this instance. Intended for diagnostic purposes only.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this instance.

deploy

public RemoteServiceInterface deploy()
                              throws ServiceException
Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.

Specified by:
deploy in interface DeployInterface
Returns:
Service obtained from a service factory.
Throws:
ServiceException - if unable to deploy the service.

deploy

public RemoteServiceInterface deploy(DiscoveryServiceInterface discoveryService)
                              throws ServiceException
Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.

Parameters:
discoveryService - The discovery service to which the service should register if it wants to be located by other services or null if the deployed service should not be registered.
Returns:
Service obtained from a service factory.
Throws:
ServiceException - if unable to deploy the service.

getServiceFactory

public final java.lang.String getServiceFactory()
Gets the name of the class that will serve as the factory used to manufacture an instance of this service.

Returns:
Service's factory class name.

hashCode

public final int hashCode()
Gets a hash code for this service attribute. The hash is an XOR of all of this service's fields.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.

equals

public boolean equals(java.lang.Object other)
Determines whether or not the other object equals this object.

Overrides:
equals in class java.lang.Object
Parameters:
other - Other object.
Returns:
true if the objects are equivalent.

compareTo

public final int compareTo(java.lang.Object deployableService)
Compares two DeployableService objects to determine ordering based upon their stated service dependencies.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
deployableService - A DeployableService whose service dependencies are to be compared to this service's dependencies.
Returns:
1 if the deployable service should be deployed before this service -1 otherwise.

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.