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

com.sas.services.deployment
Class ServiceLoader

com.sas.services.deployment.ServiceLoader

public class ServiceLoader

Service deployment utility that loads services based upon an Open Metadata Architecture (OMA) schema. This loader may be used to deploy services or to look up remote discovery services to which previously deployed services may be registered.

In the case of service deployment, if a discovery service is specified then deployed services will be registered with the discovery service to facilitate future lookup based upon their service types and optionally service attributes.

Once services are deployed they can be discovered using the DiscoveryService.

Since:
1.0

Method Summary
static java.util.List deployServices(MetadataSourceInterface metadataSource)
          Gets a set of services from the specified metadata source and registers instantiated services with the local discovery service.
static java.util.List deployServices(MetadataSourceInterface metadataSource, DiscoveryServiceInterface discoveryService)
          Gets a set of deployable services from the specified metadata source.
static java.util.List deployServices(MetadataSourceInterface metadataSource, Environment environment, DiscoveryServiceInterface discoveryService)
          Gets a set of services from the specified metadata source.
static java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource)
          Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process and binds them to the local discovery service.
static java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource, DiscoveryServiceInterface discoveryService)
          Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.
static java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSourceLookup, DiscoveryServiceInterface discoveryService, LookupPolicyInterface lookupPolicy)
          Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.
 

Method Detail

lookupRemoteDiscoveryServices

public static final java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource,
                                                                 DiscoveryServiceInterface discoveryService)
                                                          throws ServiceException,
                                                                 ServiceLookupFailedException
Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.

  1. Query OMR for all ServiceComponent elements associated with the specified SoftwareComponent that are RMI registries.
  2. Query OMR to obtain NamedService name bindings associated with each RMI registry.
  3. Determine ServiceComponent elements bound to the RMI registry that satisfy service type com.sas.services.discovery.FindServiceInterface

Parameters:
metadataSource - A source for the metadata such as an initialized instance of an OMRMetadataSource or URLMetadataSource. Note that if an OMR metadata source is specified that its connection will be closed by this method unless the metadata source's preference to be closed has been toggled off.
discoveryService - A discovery service to which deployed services will be registered.
Returns:
List of services which implement FindServiceInterface that can be used to locate other services.
Throws:
ServiceException - if unable to lookup remote discovery services.
ServiceLookupFailedException - if 1..* remote discovery service lookups fail.

lookupRemoteDiscoveryServices

public static final java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource)
                                                          throws ServiceException,
                                                                 ServiceLookupFailedException
Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process and binds them to the local discovery service.

  1. Query OMR for all ServiceComponent elements associated with the specified SoftwareComponent that are RMI registries.
  2. Query OMR to obtain NamedService name bindings associated with each RMI registry.
  3. Determine ServiceComponent elements bound to the RMI registry that satisfy service type com.sas.services.discovery.FindServiceInterface

Parameters:
metadataSource - A source for the metadata such as an initialized instance of an OMRMetadataSource or URLMetadataSource. Note that if an OMR metadata source is specified that its connection will be closed by this method unless the metadata source's preference to be closed has been toggled off.
Returns:
List of services which implement FindServiceInterface that can be used to locate other services.
Throws:
ServiceException - if unable to lookup remote discovery services.
ServiceLookupFailedException - if 1..* remote discovery service lookups fail.

lookupRemoteDiscoveryServices

public static final java.util.List lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSourceLookup,
                                                                 DiscoveryServiceInterface discoveryService,
                                                                 LookupPolicyInterface lookupPolicy)
                                                          throws ServiceException,
                                                                 ServiceLookupFailedException
Gets a set of DeployableService elements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.

  1. Query OMR for all ServiceComponent elements associated with the specified SoftwareComponent that are RMI registries.
  2. Query OMR to obtain NamedService name bindings associated with each RMI registry.
  3. Determine ServiceComponent elements bound to the RMI registry that satisfy service type com.sas.services.discovery.FindServiceInterface

The caller is responsible for destroying the deployed services by calling the destroy() method on {DiscoveryService.defaultInstance() when the application is terminated.

Parameters:
metadataSourceLookup - A source for the metadata such as an initialized instance of an OMRMetadataSource or URLMetadataSource. Note that if an OMR metadata source is specified that its connection will be closed by this method unless the metadata source's preference to be closed has been toggled off.
discoveryService - A discovery service to which deployed services will be registered.
lookupPolicy - null if the lookup should not be re-attempted in the event that it fails or an implementation of a lookup policy that will be used to specify whether or not subsequent attempts occur. Lookup policy implementations include LookupPolicyAttempts and LookupPolicyTimeout.
Returns:
List of services which implement FindServiceInterface that can be used to locate other services.
Throws:
ServiceException - if unable to lookup remote discovery services.
ServiceLookupFailedException - if 1..* remote discovery service lookups fail.

deployServices

public static final java.util.List deployServices(MetadataSourceInterface metadataSource)
                                           throws ServiceDeploymentException,
                                                  ServiceException
Gets a set of services from the specified metadata source and registers instantiated services with the local discovery service.

The caller is responsible for destroying the deployed services by calling the destroy() method on {DiscoveryService.defaultInstance() when the application is terminated.

Parameters:
metadataSource - Metadata source from which services will be queried.
Returns:
List of RemoteServiceInterface objects representing foundation services which were successfully deployed.
Throws:
ServiceDeploymentException - if unable to deploy services. This exception will cite the cause of the failure and provide a list of services which were successfully deployed. This exception is a subclass of ServiceException.
ServiceException - if unable to deploy the services.

deployServices

public static final java.util.List deployServices(MetadataSourceInterface metadataSource,
                                                  DiscoveryServiceInterface discoveryService)
                                           throws ServiceDeploymentException,
                                                  ServiceException
Gets a set of deployable services from the specified metadata source.

The caller is responsible for destroying the deployed services by calling the destroy() method on the discovery service when the application is terminated.

Parameters:
metadataSource - Metadata source from which services will be queried.
discoveryService - The discovery service to which loaded services will be registered. As services are deployed they will be registered with this discovery service.
Returns:
List of RemoteServiceInterface objects representing foundation services which were successfully deployed.
Throws:
ServiceDeploymentException - if unable to deploy services. This exception will cite the cause of the failure and provide a list of services which were successfully deployed. This exception is a subclass of ServiceException.
ServiceException - if unable to deploy the services.

deployServices

public static final java.util.List deployServices(MetadataSourceInterface metadataSource,
                                                  Environment environment,
                                                  DiscoveryServiceInterface discoveryService)
                                           throws ServiceDeploymentException,
                                                  ServiceException
Gets a set of services from the specified metadata source.

The caller is responsible for destroying the deployed services by calling the destroy() method on the discovery service when the application is terminated.

Parameters:
metadataSource - Metadata source from which services will be queried.
environment - The Environment object encapsulates resources provided by the container. It is made available to the services as they are deployed.
discoveryService - The discovery service to which loaded services will be registered. As services are deployed they will be registered with this discovery service.
Returns:
List of RemoteServiceInterface objects representing foundation services which were successfully deployed.
Throws:
ServiceDeploymentException - if unable to deploy services. This exception will cite the cause of the failure and provide a list of services which were successfully deployed. This exception is a subclass of ServiceException.
ServiceException - if unable to deploy the services.

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.