|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.discovery.RegistryDiscoveryService
public final class RegistryDiscoveryService
A discovery service which can be used to locate foundation services which have been bound to an RMI registry.
This discovery service is a stateless service which lists all of the
objects which have been bound to the RMI registry and may be used to
return a collection of services which satisfy a requested
service template
which describes the interfaces
and optionally attributes which the desired service must implement.
Field Summary |
---|
Fields inherited from interface com.sas.services.discovery.FindServiceInterface |
---|
FIND_ALL_MATCHES, FIND_ONE_MATCH |
Constructor Summary | |
---|---|
RegistryDiscoveryService()
Constructs a discovery service which may be used to locate foundation services which have been bound to the RMI registry. |
|
RegistryDiscoveryService(java.rmi.registry.Registry registry)
Constructs a discovery service which may be used to locate foundation services which have been bound to the RMI registry. |
Method Summary | |
---|---|
void |
destroy()
Destroys this discovery service. |
RemoteServiceInterface |
findService(ServiceTemplate serviceTemplate)
Finds a service using a discovery mechanism. |
Services |
findServices(ServiceTemplate serviceTemplate,
int maxNumMatches,
Services services)
Finds a collection of services via a discovery mechanism. |
RemoteServiceInterface |
findServiceUsingId(java.lang.String runtimeServiceId)
Re-acquires a previously discovered service via its service discovery ID. |
java.lang.String |
getEntityKey()
|
boolean |
sameEntity(com.sas.entities.EntityKeyInterface entity)
|
void |
setEntityKey(java.lang.String key)
|
void |
setRegistry(java.rmi.registry.Registry registry)
Sets the RMI registry from which foundation services may be looked up. |
Constructor Detail |
---|
public RegistryDiscoveryService()
Use this constructor if you want to specify the registry by calling
setRegistry(Registry)
.
public RegistryDiscoveryService(java.rmi.registry.Registry registry)
registry
- RMI registry. A non-null
registry must be specified.Method Detail |
---|
public void setRegistry(java.rmi.registry.Registry registry)
registry
- RMI registry. A null
may be specified to clear the registry.public void destroy()
public RemoteServiceInterface findService(ServiceTemplate serviceTemplate) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
ServiceAttributeInterface
findService
in interface FindServiceInterface
serviceTemplate
- Service capability template that specifies
the desired class(es) that define a service.
The template may also specify
criteria to provide additional filtering.
RemoteServiceInterface
implementation
that satisfies the requested service template. Note that
RemoteServiceInterface
is the base interface
implemented by all services.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if an unanticipated exception occurs while
processing the discovery.
ServiceNotAvailableException
- if no service satisfies
the requested service template. Note that
ServiceNotAvailableException
extends
ServiceException
.ServiceTemplate
public RemoteServiceInterface findServiceUsingId(java.lang.String runtimeServiceId) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
findServiceUsingId
in interface FindServiceInterface
runtimeServiceId
- Service's discovery ID.
RemoteServiceInterface
implementation
that satisfies the discovery parameters. Note that
RemoteServiceInterface
is the base interface
implemented by all services.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if an unanticipated exception occurs while
processing the discovery. Note that
ServiceNotAvailableException
extends
ServiceException
.
ServiceNotAvailableException
- if no service satisfies
the requested service template.public Services findServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services services) throws java.rmi.RemoteException, ServiceException, ServiceNotAvailableException
To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
com.sas.services.RemoteServiceInterface
which is implemented
by all services.
findServices
in interface FindServiceInterface
serviceTemplate
- Service capability template that specifies either
the desired class(es) that define a services.
The service template may also specify additional
criteria to provide additional filtering.maxNumMatches
- The maximum number of services that are desired.
Value should be greater than or equal to one.services
- Collection of services satisfying
the specified service capabilities or null
if there are no previously discovered services.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if an unanticipated exception occurs while
processing the discovery.
ServiceNotAvailableException
- if no service satisfies
the requested service template. Note that
ServiceNotAvailableException
extends
ServiceException
.ServiceTemplate
,
Services
public java.lang.String getEntityKey() throws java.rmi.RemoteException
getEntityKey
in interface com.sas.entities.EntityKeyInterface
java.rmi.RemoteException
public boolean sameEntity(com.sas.entities.EntityKeyInterface entity) throws java.rmi.RemoteException
sameEntity
in interface com.sas.entities.EntityKeyInterface
java.rmi.RemoteException
public void setEntityKey(java.lang.String key) throws java.rmi.RemoteException, java.lang.IllegalStateException
setEntityKey
in interface com.sas.entities.EntityKeyInterface
java.rmi.RemoteException
java.lang.IllegalStateException
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |