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

Class DeployableService

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

@SASScope("ALL") @BinaryCompatibilityOnly public class DeployableService extends Object implements Serializable, Comparable<DeployableService>, DeployInterface
This object represents a foundation service that can be deployed by the ServiceLoader utility. It represents a foundation service which is ultimately 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:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a default instance.
    protected
    DeployableService(String id, ServiceConfigurationInterface serviceConfiguration)
    Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service.
     
    DeployableService(String id, ServiceConfigurationInterface serviceConfiguration, String[] dependencies)
    Constructs an instance using the specified OMA ID for the metadata ServiceComponent that represents the foundation service.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Compares two DeployableService objects to determine ordering based upon their stated service dependencies.
    Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.
    Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.
    boolean
    equals(Object other)
    Determines whether or not the other object equals this object.
    final Set<String>
    Gets an iterator of the services on which this service depends.
    final String
    Gets the service's metadata ID.
    Gets the service configuration.
    final String
    Gets the name of the class that will serve as the factory used to manufacture an instance of this service.
    final int
    Gets a hash code for this service attribute.
    final void
    setDependencies(Set<String> dependencies)
    Gets an iterator of the services on which this service depends.
    String
    Gets a string representation of this instance.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DeployableService

      protected DeployableService()
      Constructs a default instance.
    • DeployableService

      protected DeployableService(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 instantiated 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(String id, ServiceConfigurationInterface serviceConfiguration, 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 instantiated 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 Details

    • getServiceConfiguration

      public final ServiceConfigurationInterface getServiceConfiguration()
      Gets the service configuration.
      Returns:
      Service configuration.
    • getDependencies

      public final Set<String> 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(Set<String> 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 String getId()
      Gets the service's metadata ID. This is the ServiceComponent's Id attribute.
      Returns:
      ID.
    • toString

      public String toString()
      Gets a string representation of this instance. Intended for diagnostic purposes only.
      Overrides:
      toString in class 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 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 Object
      Returns:
      Hash code.
    • equals

      public boolean equals(Object other)
      Determines whether or not the other object equals this object.
      Overrides:
      equals in class Object
      Parameters:
      other - Other object.
      Returns:
      true if the objects are equivalent.
    • compareTo

      public final int compareTo(DeployableService otherService)
      Compares two DeployableService objects to determine ordering based upon their stated service dependencies.
      Specified by:
      compareTo in interface Comparable<DeployableService>
      Parameters:
      deployableService - A DeployableService whose service dependencies are to be compared to this service's dependencies.
      Returns:
      1 if the other service should be deployed before this service -1 otherwise.