*** This class provides Binary Compatibility only, not Source Compatibility ***
Class ServiceLoader
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
Modifier and TypeMethodDescriptionstatic final List<RemoteServiceInterface> deployServices(MetadataSourceInterface metadataSource) Gets a set of services from the specified metadata source and registers instantiated services with thelocal discovery service.static final List<RemoteServiceInterface> deployServices(MetadataSourceInterface metadataSource, Environment environment, DiscoveryServiceInterface discoveryService) Gets a set of services from the specified metadata source.static final List<RemoteServiceInterface> deployServices(MetadataSourceInterface metadataSource, DiscoveryServiceInterface discoveryService) Gets a set of deployable services from the specified metadata source.static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource) Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process and binds them to the local discovery service.static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource, DiscoveryServiceInterface discoveryService) Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSourceLookup, DiscoveryServiceInterface discoveryService, LookupPolicyInterface lookupPolicy) Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
lookupRemoteDiscoveryServices
public static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource, DiscoveryServiceInterface discoveryService) throws ServiceException, ServiceLookupFailedException Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.- Query OMR for all
ServiceComponentelements associated with the specifiedSoftwareComponentthat are RMI registries. - Query OMR to obtain
NamedServicename bindings associated with each RMI registry. - Determine
ServiceComponentelements bound to the RMI registry that satisfy service typecom.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
FindServiceInterfacethat can be used to locate other services. - Throws:
ServiceException- if unable to lookup remote discovery services.ServiceLookupFailedException- if 1..* remote discovery service lookups fail.
- Query OMR for all
-
lookupRemoteDiscoveryServices
public static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSource) throws ServiceException, ServiceLookupFailedException Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process and binds them to the local discovery service.- Query OMR for all
ServiceComponentelements associated with the specifiedSoftwareComponentthat are RMI registries. - Query OMR to obtain
NamedServicename bindings associated with each RMI registry. - Determine
ServiceComponentelements bound to the RMI registry that satisfy service typecom.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
FindServiceInterfacethat can be used to locate other services. - Throws:
ServiceException- if unable to lookup remote discovery services.ServiceLookupFailedException- if 1..* remote discovery service lookups fail.
- Query OMR for all
-
lookupRemoteDiscoveryServices
public static final List<FindServiceInterface> lookupRemoteDiscoveryServices(MetadataSourceInterface metadataSourceLookup, DiscoveryServiceInterface discoveryService, LookupPolicyInterface lookupPolicy) throws ServiceException, ServiceLookupFailedException Gets a set ofDeployableServiceelements representing remote discovery services that may be available if previously deployed by foundation bootstrap process.- Query OMR for all
ServiceComponentelements associated with the specifiedSoftwareComponentthat are RMI registries. - Query OMR to obtain
NamedServicename bindings associated with each RMI registry. - Determine
ServiceComponentelements bound to the RMI registry that satisfy service typecom.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-nullif 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 includeLookupPolicyAttemptsandLookupPolicyTimeout.- Returns:
- List of services which implement
FindServiceInterfacethat can be used to locate other services. - Throws:
ServiceException- if unable to lookup remote discovery services.ServiceLookupFailedException- if 1..* remote discovery service lookups fail.
- Query OMR for all
-
deployServices
public static final List<RemoteServiceInterface> deployServices(MetadataSourceInterface metadataSource) throws ServiceDeploymentException, ServiceException Gets a set of services from the specified metadata source and registers instantiated services with thelocal 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
RemoteServiceInterfaceobjects 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 List<RemoteServiceInterface> 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
RemoteServiceInterfaceobjects 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 List<RemoteServiceInterface> 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
RemoteServiceInterfaceobjects 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.
-