com.sas.services
Class AbstractService

com.sas.services.AbstractService
All Implemented Interfaces:
com.sas.entities.EntityKeyInterface, ServiceNotificationBroadcasterInterface, RemoteServiceInterface, java.rmi.Remote
Direct Known Subclasses:
AbstractDiscoveryService

public abstract class AbstractService

Abstract implementation of a service. A service may extend this implementation if it is only 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

Field Summary
 
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
AbstractService(DiscoveryServiceInterface discoveryService)
          Constructs a service.
 
Method Summary
 void configure(ServiceConfigurationInterface serviceConfiguration)
          Configures the service.
 void destroy()
          Destroys the service.
 java.lang.String getEntityKey()
          Gets the service's entity key.
 
Methods inherited from class com.sas.services.AbstractRemoteService
addServiceObserver, bindToDiscoveryService, getCreationTime, getDetails, getDiscoveryService, getEnvironment, getServiceConfiguration, getServiceConfiguration, getServiceProxy, getServiceState, handleJVMShutdown, isAccessibleToRemoteClients, isExported, isHandlingJVMShutdown, notifyServiceObservers, reconfigure, removeAllServiceObservers, removeServiceObserver, sameEntity, setDiscoveryService, setEntityKey, setRemoteableExporter, setServiceState, toString, unbindFromDiscoveryService
 

Constructor Detail

AbstractService

public AbstractService(DiscoveryServiceInterface discoveryService)
Constructs a service.

Parameters:
discoveryService - A discovery service which may be used to locate other services and to which a service must bind in order to be discoverable by other services.
Method Detail

configure

public void configure(ServiceConfigurationInterface serviceConfiguration)
               throws InitializationException,
                      ServiceException
Configures the service.

Specified by:
configure in interface RemoteServiceInterface
Overrides:
configure in class AbstractRemoteService
Parameters:
serviceConfiguration - Service's configuration.
Throws:
InitializationException - in unable to configure the service.
ServiceException - if a service exception is encountered.

getEntityKey

public java.lang.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.

Specified by:
getEntityKey in interface com.sas.entities.EntityKeyInterface
Overrides:
getEntityKey in class AbstractRemoteService
Returns:
The service's entity key or null if unable to determine the entity key.
Throws:
java.lang.IllegalStateException - if the service has been destroyed.
See Also:
AbstractRemoteService.getEntityKey()

destroy

public void destroy()
             throws ServiceException
Destroys the service.

Specified by:
destroy in interface RemoteServiceInterface
Overrides:
destroy in class AbstractRemoteService
Throws:
ServiceException - if unable to cleanly destroy the service.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.