Package com.sas.services
Class AbstractService
java.lang.Object
com.sas.services.AbstractRemoteService
com.sas.services.AbstractService
- All Implemented Interfaces:
com.sas.entities.EntityKeyInterface,ServiceNotificationBroadcasterInterface,RemoteServiceInterface,Remote
- Direct Known Subclasses:
AbstractDiscoveryService
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:
-
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
ConstructorsConstructorDescriptionAbstractService(DiscoveryServiceInterface discoveryService) Constructs a service. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ServiceConfigurationInterface serviceConfiguration) Configures the service.voiddestroy()Destroys the service.StringGets 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, unbindFromDiscoveryServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
AbstractService
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 Details
-
configure
public void configure(ServiceConfigurationInterface serviceConfiguration) throws InitializationException, ServiceException Configures the service.- Specified by:
configurein interfaceRemoteServiceInterface- Overrides:
configurein classAbstractRemoteService- Parameters:
serviceConfiguration- Service's configuration.- Throws:
InitializationException- in unable to configure the service.ServiceException- if a service exception is encountered.
-
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.- Specified by:
getEntityKeyin interfacecom.sas.entities.EntityKeyInterface- Overrides:
getEntityKeyin classAbstractRemoteService- Returns:
- The service's entity key or
nullif unable to determine the entity key. - Throws:
IllegalStateException- if the service has been destroyed.- See Also:
-
destroy
Destroys the service.- Specified by:
destroyin interfaceRemoteServiceInterface- Overrides:
destroyin classAbstractRemoteService- Throws:
ServiceException- if unable to cleanly destroy the service.
-