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

com.sas.services.discovery
Class RemoteDiscoveryServiceProxy

com.sas.services.discovery.RemoteDiscoveryServiceProxy
All Implemented Interfaces:
com.sas.entities.EntityKeyInterface, DiscoveryAdminInterface, DiscoveryServiceInterface, FindServiceInterface, RemoteDiscoveryServiceInterface, ServiceNotificationBroadcasterInterface, RemoteServiceInterface, java.io.Serializable, java.rmi.Remote

public class RemoteDiscoveryServiceProxy
implements RemoteDiscoveryServiceInterface, java.io.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:
Serialized Form

Field Summary
 
Fields inherited from interface com.sas.services.discovery.FindServiceInterface
FIND_ALL_MATCHES, FIND_ONE_MATCH
 
Fields 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
RemoteDiscoveryServiceProxy(DiscoveryServiceInterface discoveryService)
          Constructs a proxy to the specified discovery service.
 
Method Summary
 void addDiscoveryDelegate(FindServiceInterface serviceFinder)
          Adds an delegate that is capable of discovering implementations.
 void addService(RemoteServiceInterface serviceIf)
          Adds a service to the registry.
 RemoteServiceInterface findService(ServiceTemplate serviceTemplate)
          Finds a service using a discovery mechanism.
 Services findServices(ServiceTemplate serviceTemplate, int maxNumMatches, Services discoveredServices)
          Finds a collection of objects via a discovery mechanism.
 RemoteServiceInterface findServiceUsingId(java.lang.String serviceId)
          Re-acquires a previously discovered service via its service discovery ID.
 java.util.Iterator getDiscoverers()
          Gets an iterator of the discovery services.
 java.util.Iterator getLocalServices()
          Gets an iterator of local objects that implement the RemoteServiceInterface interface.
 java.util.Iterator getRemoteServices()
          Gets an iterator of registered services.
 RemoteServiceInterface getServiceProxy()
          Gets the service proxy.
 void removeDiscoveryDelegate(FindServiceInterface serviceFinder)
          Removes an agent previously added as a discovery agent.
 void removeService(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, setServiceState
 
Methods inherited from interface com.sas.services.RemoteServiceInterface
configure, destroy, getCreationTime, getServiceConfiguration, getServiceConfiguration, getServiceState, isAccessibleToRemoteClients, isExported, reconfigure, setServiceState
 
Methods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface
addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver
 

Constructor Detail

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 Detail

getServiceProxy

public final RemoteServiceInterface getServiceProxy()
Gets the service proxy.

Specified by:
getServiceProxy in interface RemoteServiceInterface
Overrides:
getServiceProxy in class ServiceProxy
Returns:
A proxy to this service or null if a proxy is not available.

findServiceUsingId

public RemoteServiceInterface findServiceUsingId(java.lang.String serviceId)
                                          throws ServiceException,
                                                 ServiceNotAvailableException,
                                                 java.rmi.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:
findServiceUsingId in interface FindServiceInterface
Parameters:
serviceId - Service's discovery ID.
Returns:
RemoteServiceInterface implementation that satisfies the discovery parameters. Note that RemoteServiceInterface is the base interface implemented by all services.
Throws:
ServiceException - if an unanticipated exception occurs while processing the discovery. Note that ServiceNotAvailableException extends ServiceException.
ServiceNotAvailableException - if no service satisfies the requested service template.
java.rmi.RemoteException - if a network anomaly is encountered.

findService

public final RemoteServiceInterface findService(ServiceTemplate serviceTemplate)
                                         throws ServiceException,
                                                ServiceNotAvailableException,
                                                java.rmi.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:

Specified by:
findService in interface FindServiceInterface
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:
RemoteServiceInterface implementation that satisfies the requested service template. Note that RemoteServiceInterface is 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 that ServiceNotAvailableException extends ServiceException.
java.rmi.RemoteException - if a network anomaly is encountered.
See Also:
ServiceTemplate

findServices

public final Services findServices(ServiceTemplate serviceTemplate,
                                   int maxNumMatches,
                                   Services discoveredServices)
                            throws ServiceException,
                                   ServiceNotAvailableException,
                                   java.rmi.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:

Specified by:
findServices in interface FindServiceInterface
Parameters:
serviceTemplate - Service capability template that specifies either
  1. a service ID to retrieve a particular service
  2. 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 to null if 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:
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.
See Also:
ServiceTemplate

addDiscoveryDelegate

public void addDiscoveryDelegate(FindServiceInterface serviceFinder)
                          throws java.rmi.RemoteException
Adds an delegate that is capable of discovering implementations.

Specified by:
addDiscoveryDelegate in interface DiscoveryAdminInterface
Parameters:
serviceFinder - Discovery service implementation.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

removeDiscoveryDelegate

public void removeDiscoveryDelegate(FindServiceInterface serviceFinder)
                             throws java.rmi.RemoteException
Removes an agent previously added as a discovery agent.

Specified by:
removeDiscoveryDelegate in interface DiscoveryAdminInterface
Parameters:
serviceFinder - Discovery service implementation to remove.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

getRemoteServices

public java.util.Iterator getRemoteServices()
                                     throws java.rmi.RemoteException
Gets an iterator of registered services.

Specified by:
getRemoteServices in interface DiscoveryAdminInterface
Returns:
Iterator of remotely available services that implement the RemoteServiceInterface interface.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

getLocalServices

public final java.util.Iterator getLocalServices()
                                          throws java.rmi.RemoteException
Gets an iterator of local objects that implement the RemoteServiceInterface interface.

Specified by:
getLocalServices in interface DiscoveryAdminInterface
Returns:
Iterator of locally available services that implement the RemoteServiceInterface interface.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

removeService

public void removeService(RemoteServiceInterface serviceIf)
                   throws java.rmi.RemoteException
Removes a service from the registry.

Specified by:
removeService in interface DiscoveryAdminInterface
Parameters:
serviceIf - Service that is to be removed.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

getDiscoverers

public final java.util.Iterator getDiscoverers()
                                        throws java.rmi.RemoteException
Gets an iterator of the discovery services.

Specified by:
getDiscoverers in interface DiscoveryAdminInterface
Returns:
Iterator of discovery delegates.
Throws:
java.rmi.RemoteException - if a network anomaly is encountered.

addService

public void addService(RemoteServiceInterface serviceIf)
                throws ServiceException,
                       java.rmi.RemoteException
Adds a service to the registry.

Specified by:
addService in interface DiscoveryAdminInterface
Parameters:
serviceIf - Service that is discoverable via its service capabilities.
Throws:
ServiceException - if unable to cache the service.
java.rmi.RemoteException - if a network anomaly is encountered.

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.