|
| Services |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
java.lang.Object | +--com.sas.services.ServiceProxy
Foundation service proxy. If the service is available locally then a local reference will be used. If a local reference isn't available, then the remote service stub will be proxied.
Some attributes of a service are defined at the time a service is constructed an not alterable.
The following attributes are not cached to ensure that the current value is always obtained.
Some service methods may not be invoked by a client that is remote to the process in which the service was instantiated. These methods will be ignored if invoked by a remote client.
| Fields inherited from interface com.sas.services.RemoteServiceInterface |
CLASS_IDENTIFIER |
| Constructor Summary | |
ServiceProxy(RemoteServiceInterface service)
Constructs a foundation service proxy for the specified service. |
|
| Method Summary | |
void |
addServiceObserver(ServiceRemoteObserverInterface serviceObserver)
Adds a service observer. |
void |
configure(ServiceConfigurationInterface serviceConfiguration)
Configures the service. |
void |
destroy()
Destroys the service proxy. |
protected RemoteServiceInterface |
findRemoteService()
Attempts to rediscover an instance of a remote service represented by this proxy. |
long |
getCreationTime()
Gets the time at which this service was created. |
String |
getEntityKey()
Gets the service proxy's entity key. |
protected RemoteServiceInterface |
getService()
Gets the service. |
ServiceConfigurationInterface |
getServiceConfiguration()
Gets the service's configuration. |
ServiceConfigurationInterface |
getServiceConfiguration(Object key)
Gets the service's configuration associated with the specified lookup key. |
RemoteServiceInterface |
getServiceProxy()
Gets the service proxy. |
short |
getServiceState()
Gets the foundation service's state. |
boolean |
isAccessibleToRemoteClients()
Determines whether or not the service is accessible to remote clients. |
boolean |
isExported()
Determines whether or not the service has been exported to the RMI system. |
boolean |
isLocalService()
Determines whether or not this proxy has a local handle to the service. |
boolean |
isProxyToRemoteService()
Determines whether or not this is a proxy to a remote service |
void |
notifyServiceObservers(ServiceEvent serviceEvent)
Notify all registered service observers of the specified service event. |
void |
removeAllServiceObservers()
Removes all service observers. |
void |
removeServiceObserver(ServiceRemoteObserverInterface serviceObserver)
Removes a service observer. |
boolean |
sameEnitityKey(String entityKey)
Determines if the this service's entity key is the same. |
boolean |
sameEntity(EntityKeyInterface entity)
Determines whether or not the specified entity is the same as this entity. |
void |
setEntityKey(String entityKey)
|
void |
setServiceState(ServiceState serviceState)
Sets the state of the service. |
String |
toString()
Gets a string representation of this service proxy. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ServiceProxy(RemoteServiceInterface service)
throws InitializationException
service - Foundation service.InitializationException - if an invalid service
is specified.| Method Detail |
protected final RemoteServiceInterface getService()
throws IllegalStateException
If the proxied service is a stub to a remote service which
is no longer available because it is not reachable on a
particular host:port, then a ConnectException
will be thrown when one attempts to invoke a service method.
If the proxied service is a stub to a remote service which
is no longer available because it is not reachable on a
particular host and well known port, then a NoSuchObjectException
will be thrown when one attempts to invoke a service method.
This indicates that the remote object is no longer registered
in the remote JVM by the specified object ID.
findRemoteService() to attempt to re-initialize
this proxy with another remote service stub that satisfies
the same service template as the original proxied service.
IllegalStateException - if the service has been destroyed.
public final void configure(ServiceConfigurationInterface serviceConfiguration)
throws ServiceException,
RemoteException
RemoteServiceInterface
An InitializationException will be thrown if the service
is unable to complete the configuration request successfully.
Suggested policy for handling such an exception is for the service to
invoke its destroy() method if a service is being initialized.
A ServiceException will be thrown if a request to
reconfigure the service fails and the service is able to restore its
previous configuration. If a reconfiguration request fails and the
service is unable to restore its previous configuration, then an
InitializationException should be thrown instead of a
ServiceException.
configure in interface RemoteServiceInterfaceIllegalStateException - if service re-configuration is not supported.RemoteServiceInterface.configure(com.sas.services.ServiceConfigurationInterface)
public boolean isExported()
throws ServiceException
isExported in interface RemoteServiceInterfacetrue if the service has been exported or
false if it hasn't.ServiceException - if unable to process the request.
public boolean isAccessibleToRemoteClients()
throws ServiceException
isAccessibleToRemoteClients in interface RemoteServiceInterfacetrue if the service is intended to be accessible
to remote clients or
false if it isn't.ServiceException - if unable to process the request.public final long getCreationTime()
RemoteServiceInterfacegetCreationTime in interface RemoteServiceInterfaceRemoteServiceInterface.getCreationTime()
public final short getServiceState()
throws RemoteException
getServiceState in interface RemoteServiceInterfaceRemoteException - if unable to ascertain the state
of a remote service.
public final void setServiceState(ServiceState serviceState)
throws ServiceException
RemoteServiceInterfacesetServiceState in interface RemoteServiceInterfaceRemoteServiceInterface.setServiceState(com.sas.services.ServiceState)public final ServiceConfigurationInterface getServiceConfiguration()
getServiceConfiguration in interface RemoteServiceInterfacenull if a configuration
is not defined.public final ServiceConfigurationInterface getServiceConfiguration(Object key)
RemoteServiceInterfacenull.getServiceConfiguration in interface RemoteServiceInterfaceRemoteServiceInterface.getServiceConfiguration(java.lang.Object)public RemoteServiceInterface getServiceProxy()
getServiceProxy in interface RemoteServiceInterfacenull
if a proxy is not available.
public final void addServiceObserver(ServiceRemoteObserverInterface serviceObserver)
throws RemoteException
addServiceObserver in interface ServiceNotificationBroadcasterInterfaceserviceObserver - An observer interested in receiving service notifications.RemoteException - if a network anomaly is encountered.
public final void removeServiceObserver(ServiceRemoteObserverInterface serviceObserver)
throws RemoteException
removeServiceObserver in interface ServiceNotificationBroadcasterInterfaceserviceObserver - An observer no longer interested in receiving service notifications.RemoteException - if a network anomaly is encountered.
public final void removeAllServiceObservers()
throws RemoteException
removeAllServiceObservers in interface ServiceNotificationBroadcasterInterfaceRemoteException - if a network anomaly is encountered.
public final void notifyServiceObservers(ServiceEvent serviceEvent)
throws RemoteException
notifyServiceObservers in interface ServiceNotificationBroadcasterInterfaceserviceEvent - Service event to be broadcast to all registered service observers.RemoteException - if a network anomaly is encountered.public final void destroy()
destroy in interface RemoteServiceInterfacecom.sas.services.RemoteServiceInterfaceRemoteException - if a network anomaly is encountered.ServiceException - if the service is unable to prepare itself
for destruction.public final String getEntityKey()
getEntityKey in interface EntityKeyInterfacenull ID indicates
that an entity key could not be determined for the service
indicating that the service is not accessible.public final void setEntityKey(String entityKey)
setEntityKey in interface EntityKeyInterfaceEntityKeyInterface.setEntityKey(String)public final boolean sameEntity(EntityKeyInterface entity)
sameEntity in interface EntityKeyInterfaceentity - Entity to be comparedtrue if the entities are the same.EntityKeyInterface.sameEntity(EntityKeyInterface)public final boolean sameEnitityKey(String entityKey)
entityKey - Another service's entity key.true if the entity key's are the same.public final boolean isProxyToRemoteService()
true if this is a proxy to a remote service
or false if it is a proxy to local service.public final boolean isLocalService()
true if the service is local.public String toString()
toString in class Object
protected RemoteServiceInterface findRemoteService()
throws ServiceException,
RemoteException
null if the service is not available.ServiceException - if unable to rediscover the service.RemoteException - if unable to discover a networked service.
|
| Services |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||