*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.deployment
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
ConstructorsModifierConstructorDescriptionprotectedConstructs a default instance.protectedDeployableService(String id, ServiceConfigurationInterface serviceConfiguration) Constructs an instance using the specified OMA ID for the metadataServiceComponentthat represents the foundation service.DeployableService(String id, ServiceConfigurationInterface serviceConfiguration, String[] dependencies) Constructs an instance using the specified OMA ID for the metadataServiceComponentthat represents the foundation service. -
Method Summary
Modifier and TypeMethodDescriptionfinal intcompareTo(DeployableService otherService) Compares twoDeployableServiceobjects to determine ordering based upon their stated service dependencies.deploy()Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.deploy(DiscoveryServiceInterface discoveryService) Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.booleanequals(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 StringgetId()Gets the service's metadata ID.Gets the service configuration.final StringGets the name of the class that will serve as the factory used to manufacture an instance of this service.final inthashCode()Gets a hash code for this service attribute.final voidsetDependencies(Set<String> dependencies) Gets an iterator of the services on which this service depends.StringtoString()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 metadataServiceComponentthat 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 IDserviceConfiguration- 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 metadataServiceComponentthat 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. Anullparameter value indicates that there are no other dependencies.- Throws:
ServiceException- if unable to construct an instance.
-
-
Method Details
-
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 typeStringrepresenting 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 typeStringrepresenting an ID value associated with the service.- Parameters:
dependencies- Set containing 0..* elements of typeStringrepresenting a service ID on which this service depends.
-
getId
public final String getId()Gets the service's metadata ID. This is theServiceComponent'sIdattribute.- Returns:
- ID.
-
toString
public String toString()Gets a string representation of this instance. Intended for diagnostic purposes only.- Overrides:
toStringin classObject- Returns:
- String representation of this instance.
-
deploy
Deploys a service by constructing a service factory and asking it to manufacture a service for a specified service configuration.- Specified by:
deployin interfaceDeployInterface- 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 ornullif 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:
hashCodein classObject- Returns:
- Hash code.
-
equals
public boolean equals(Object other) Determines whether or not the other object equals this object.- Overrides:
equalsin classObject- Parameters:
other- Other object.- Returns:
trueif the objects are equivalent.
-
compareTo
Compares twoDeployableServiceobjects to determine ordering based upon their stated service dependencies.- Specified by:
compareToin interfaceComparable<DeployableService>- Parameters:
deployableService- ADeployableServicewhose service dependencies are to be compared to this service's dependencies.- Returns:
1if the other service should be deployed before this service-1otherwise.
-