*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.discovery
Class RemoteDiscoveryServiceProxy
java.lang.Object
com.sas.services.ServiceProxy
com.sas.services.discovery.RemoteDiscoveryServiceProxy
- All Implemented Interfaces:
com.sas.entities.EntityKeyInterface,DiscoveryAdminInterface,DiscoveryServiceInterface,FindServiceInterface,RemoteDiscoveryServiceInterface,ServiceNotificationBroadcasterInterface,RemoteServiceInterface,Serializable,Remote
@SASScope("ALL")
@BinaryCompatibilityOnly
public class RemoteDiscoveryServiceProxy
extends ServiceProxy
implements RemoteDiscoveryServiceInterface, Serializable
Proxy to a discovery service that is capable of servicing
remote clients.
If this proxy is serialized to a remote process then the proxy will optimize calls to ensure that a local object reference is used where appropriate and that static data is cached locally to minimize remote calls.
- Since:
- 1.1
- See Also:
-
Field Summary
Fields inherited from interface com.sas.services.discovery.FindServiceInterface
FIND_ALL_MATCHES, FIND_ONE_MATCHFields inherited from interface com.sas.services.RemoteServiceInterface
CLASS_IDENTIFIER, CLASS_IDENTIFIER_1_1, CLASS_IDENTIFIER_1_2, CLASS_IDENTIFIER_SERVICE_TYPE, CLASS_IDENTIFIER_SERVICE_TYPE_1_1, CLASS_IDENTIFIER_SERVICE_TYPE_1_2 -
Constructor Summary
ConstructorsConstructorDescriptionRemoteDiscoveryServiceProxy(DiscoveryServiceInterface discoveryService) Constructs a proxy to the specified discovery service. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDiscoveryDelegate(FindServiceInterface serviceFinder) Adds an delegate that is capable of discovering implementations.voidaddService(RemoteServiceInterface serviceIf) Adds a service to the registry.final RemoteServiceInterfacefindService(ServiceTemplate serviceTemplate) Finds a service using a discovery mechanism.final ServicesfindServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services discoveredServices) Finds a collection of objects via a discovery mechanism.findServiceUsingId(String serviceId) Re-acquires a previously discovered service via its service discovery ID.final Iterator<FindServiceInterface> Gets an iterator of the discovery services.final Iterator<RemoteServiceInterface> Gets an iterator of local objects that implement theRemoteServiceInterfaceinterface.Iterator<RemoteServiceInterface> Gets an iterator of registered services.final RemoteServiceInterfaceGets the service proxy.voidremoveDiscoveryDelegate(FindServiceInterface serviceFinder) Removes an agent previously added as a discovery agent.voidremoveService(RemoteServiceInterface serviceIf) Removes a service from the registry.Methods inherited from class com.sas.services.ServiceProxy
addServiceObserver, configure, destroy, findRemoteService, getCreationTime, getEntityKey, getService, getServiceConfiguration, getServiceConfiguration, getServiceState, isAccessibleToRemoteClients, isExported, isLocalService, isProxyToRemoteService, notifyServiceObservers, reconfigure, removeAllServiceObservers, removeServiceObserver, sameEnitityKey, sameEntity, setEntityKey, setServiceStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sas.entities.EntityKeyInterface
getEntityKey, sameEntity, setEntityKeyMethods inherited from interface com.sas.services.RemoteServiceInterface
configure, destroy, getCreationTime, getServiceConfiguration, getServiceConfiguration, getServiceState, isAccessibleToRemoteClients, isExported, reconfigure, setServiceStateMethods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface
addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver
-
Constructor Details
-
RemoteDiscoveryServiceProxy
public RemoteDiscoveryServiceProxy(DiscoveryServiceInterface discoveryService) throws InitializationException Constructs a proxy to the specified discovery service.- Parameters:
discoveryService- Remote discovery service to be proxied.- Throws:
InitializationException- if unable to create a proxy for the discovery service.
-
-
Method Details
-
getServiceProxy
Gets the service proxy.- Specified by:
getServiceProxyin interfaceRemoteServiceInterface- Overrides:
getServiceProxyin classServiceProxy- Returns:
- A proxy to this service or
nullif a proxy is not available.
-
findServiceUsingId
public RemoteServiceInterface findServiceUsingId(String serviceId) throws ServiceException, ServiceNotAvailableException, RemoteException Re-acquires a previously discovered service via its service discovery ID. The service discovery ID is runtime ID that is unique across JVMs and only used in the context of discovering a service.- Specified by:
findServiceUsingIdin interfaceFindServiceInterface- Parameters:
serviceId- Service's discovery ID.- Returns:
RemoteServiceInterfaceimplementation that satisfies the discovery parameters. Note thatRemoteServiceInterfaceis the base interface implemented by all services.- Throws:
ServiceException- if an unanticipated exception occurs while processing the discovery. Note thatServiceNotAvailableExceptionextendsServiceException.ServiceNotAvailableException- if no service satisfies the requested service template.RemoteException- if a network anomaly is encountered.
-
findService
public final RemoteServiceInterface findService(ServiceTemplate serviceTemplate) throws ServiceException, ServiceNotAvailableException, RemoteException Finds a service using a discovery mechanism.To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
- class(es) the service is, extends, or implements
- additional filtering criteria expressed in terms of
ServiceAttributeInterface
- Specified by:
findServicein interfaceFindServiceInterface- Parameters:
serviceTemplate- Service capability template that specifies the desired class(es) that define a service. The template may also specify criteria to provide additional filtering.- Returns:
RemoteServiceInterfaceimplementation that satisfies the requested service template. Note thatRemoteServiceInterfaceis the base interface implemented by all services.- Throws:
ServiceException- if an unanticipated exception occurs while processing the discovery.ServiceNotAvailableException- if no service satisfies the requested service template. Note thatServiceNotAvailableExceptionextendsServiceException.RemoteException- if a network anomaly is encountered.- See Also:
-
findServices
public final Services findServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services discoveredServices) throws ServiceException, ServiceNotAvailableException, RemoteException Finds a collection of objects via a discovery mechanism.To be considered a successful match, the service must satisfy the requested service template which may be used to specify:
- a service ID
- classes the service is, extends, or implements
- additional filtering criteria
- Specified by:
findServicesin interfaceFindServiceInterface- Parameters:
serviceTemplate- Service capability template that specifies either- a service ID to retrieve a particular service
- the desired classes that define a service. One may also specify additional criteria to provide additional filtering.
maxNumMatches- Maximum number of services.discoveredServices- A collection containing services that have already been found. Set this parameter tonullif no services have been found yet.- Returns:
- A collection containing search results. Each collection element will either be, implement, or extend the requested classes.
- Throws:
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.- See Also:
-
addDiscoveryDelegate
Adds an delegate that is capable of discovering implementations.- Specified by:
addDiscoveryDelegatein interfaceDiscoveryAdminInterface- Parameters:
serviceFinder- Discovery service implementation.- Throws:
RemoteException- if a network anomaly is encountered.
-
removeDiscoveryDelegate
Removes an agent previously added as a discovery agent.- Specified by:
removeDiscoveryDelegatein interfaceDiscoveryAdminInterface- Parameters:
serviceFinder- Discovery service implementation to remove.- Throws:
RemoteException- if a network anomaly is encountered.
-
getRemoteServices
Gets an iterator of registered services.- Specified by:
getRemoteServicesin interfaceDiscoveryAdminInterface- Returns:
- Iterator of remotely available services that
implement the
RemoteServiceInterfaceinterface. - Throws:
RemoteException- if a network anomaly is encountered.
-
getLocalServices
Gets an iterator of local objects that implement theRemoteServiceInterfaceinterface.- Specified by:
getLocalServicesin interfaceDiscoveryAdminInterface- Returns:
- Iterator of locally available services that
implement the
RemoteServiceInterfaceinterface. - Throws:
RemoteException- if a network anomaly is encountered.
-
removeService
Removes a service from the registry.- Specified by:
removeServicein interfaceDiscoveryAdminInterface- Parameters:
serviceIf- Service that is to be removed.- Throws:
RemoteException- if a network anomaly is encountered.
-
getDiscoverers
Gets an iterator of the discovery services.- Specified by:
getDiscoverersin interfaceDiscoveryAdminInterface- Returns:
- Iterator of discovery delegates.
- Throws:
RemoteException- if a network anomaly is encountered.
-
addService
Adds a service to the registry.- Specified by:
addServicein interfaceDiscoveryAdminInterface- Parameters:
serviceIf- Service that is discoverable via its service capabilities.- Throws:
ServiceException- if unable to cache the service.RemoteException- if a network anomaly is encountered.
-