com.sas.services
Class AbstractService

java.lang.Object
  |
  +--com.sas.services.AbstractRemoteService
        |
        +--com.sas.services.AbstractService
All Implemented Interfaces:
RemoteServiceInterface, ServiceNotificationBroadcasterInterface
Direct Known Subclasses:
AbstractDiscoveryService

public abstract class AbstractService
extends AbstractRemoteService

Abstract implementation of a service. A service may extend this implementation if it is only intended to be used within a local JVM process.

This class extends com.sas.services.AbstractRemoteService which provides a version that may be used used in a distributed environment where the service needs to be made available to remote clients.

Methods specified in this local version do not throw RemoteException.

Since:
1.0
See Also:
ServiceConfigurationInterface

Fields inherited from interface com.sas.services.RemoteServiceInterface
CLASS_IDENTIFIER
 
Constructor Summary
AbstractService()
          Constructs a default instance.
 
Method Summary
 void configure(ServiceConfigurationInterface serviceConfiguration)
          Configures the service.
 void destroy()
          Destroys the service.
 long getCreationTime()
          Gets the time at which this configuration was created.
 String getEntityKey()
          Gets the service's entity key.
 ServiceConfigurationInterface getServiceConfiguration()
          Gets this service's configuration.
 short getServiceState()
          Gets the 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.
 void setServiceState(ServiceState serviceState)
          Sets the service's state.
 
Methods inherited from class com.sas.services.AbstractRemoteService
addServiceObserver, getServiceConfiguration, getServiceProxy, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver, sameEntity, setEntityKey, setRemoteableExporter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractService

public AbstractService()
Constructs a default instance.
Method Detail

getServiceConfiguration

public final ServiceConfigurationInterface getServiceConfiguration()
Description copied from class: AbstractRemoteService
Gets this service's configuration. The service configuration may contain ancillary sub-configurations which are available via a hash map lookup.

The service's configuration can always be retrieved irregardless of the service's state.

Overrides:
getServiceConfiguration in class AbstractRemoteService
Following copied from class: com.sas.services.AbstractRemoteService
Returns:
Service's configuration.
Throws:
RemoteException - if a network anomaly occurs.

configure

public void configure(ServiceConfigurationInterface serviceConfiguration)
               throws InitializationException,
                      ServiceException
Description copied from class: AbstractRemoteService
Configures the service.
Overrides:
configure in class AbstractRemoteService
Following copied from class: com.sas.services.AbstractRemoteService
Parameters:
serviceConfiguration - Service's configuration.
Throws:
InitializationException - in unable to configure the service.
ServiceException - if a service exception is encountered.
RemoteException - if a network anomaly occurs.

getServiceState

public short getServiceState()
Description copied from class: AbstractRemoteService
Gets the service's state.
Overrides:
getServiceState in class AbstractRemoteService
Following copied from class: com.sas.services.AbstractRemoteService
Returns:
Service's state.
Throws:
RemoteException - if a network anomaly occurs.

setServiceState

public void setServiceState(ServiceState serviceState)
                     throws ServiceException,
                            RemoteException
Description copied from class: AbstractRemoteService
Sets the service's state.
Overrides:
setServiceState in class AbstractRemoteService
Following copied from class: com.sas.services.AbstractRemoteService
Parameters:
serviceState - Service's new state.
Throws:
ServiceException - if unable to process the request.
RemoteException - if a network anomaly occurs.

getCreationTime

public long getCreationTime()
Gets the time at which this configuration was created. Can be used to order services based upon their creation times. Originally specified using currentTimeMillis().
Overrides:
getCreationTime in class AbstractRemoteService
Returns:
Time at which this configuration was created or 0 if the time can't be determined.

isExported

public boolean isExported()
                   throws ServiceException
Determines whether or not the service has been exported to the RMI system.
Overrides:
isExported in class AbstractRemoteService
Returns:
true if the service has been exported or false if it hasn't.
Throws:
ServiceException - if unable to process the request.

isAccessibleToRemoteClients

public boolean isAccessibleToRemoteClients()
                                    throws ServiceException
Determines whether or not the service is accessible to remote clients.
Overrides:
isAccessibleToRemoteClients in class AbstractRemoteService
Returns:
true if the service is intended to be accessible to remote clients or false if it isn't.
Throws:
ServiceException - if unable to process the request.

getEntityKey

public String getEntityKey()
Gets the service's entity key. The only purpose of this method is to catch the RemoteException that may be thrown by the superclass.
Overrides:
getEntityKey in class AbstractRemoteService
Returns:
The service's entity key or null if unable to determine the entity key.
Throws:
IllegalStateException - if the service has been destroyed.
See Also:
AbstractRemoteService.getEntityKey()

destroy

public void destroy()
             throws ServiceException
Destroys the service.
Overrides:
destroy in class AbstractRemoteService
Throws:
ServiceException - if unable to cleanly destroy the service.




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:52