Interface ServiceInterface
- All Superinterfaces:
com.sas.entities.EntityKeyInterface,Remote,RemoteServiceInterface,ServiceNotificationBroadcasterInterface
While this interface extends
com.sas.services.RemoteServiceInterface, note that this interface
does not throw RemoteException, thereby facilitating a
service interface that may be used locally within a JVM process.
- Since:
- 1.0
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ServiceConfigurationInterface serviceConfiguration) Configures the service.voiddestroy()Destroys the service.longGets the time at which this configuration was created.Gets the service's configuration.Gets the service proxy.shortGets the current state of the service.booleanDetermines whether or not the service is accessible to remote clients.booleanDetermines whether or not the service has been exported to the RMI system.voidsetServiceState(ServiceState serviceState) Sets the state of the service.Methods inherited from interface com.sas.entities.EntityKeyInterface
getEntityKey, sameEntity, setEntityKeyMethods inherited from interface com.sas.services.RemoteServiceInterface
getServiceConfiguration, reconfigureMethods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface
addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver
-
Method Details
-
destroy
Destroys the service. This method should only be invoked after a service has been configured. It is suggested that the service invoke the destroy method if a configuration request fails and the service is not in a stable state.The service should release any resources it holds in preparation for termination of use of this service.
- Specified by:
destroyin interfaceRemoteServiceInterface- Throws:
ServiceException- if the service is unable to prepare itself for destruction.
-
getServiceConfiguration
ServiceConfigurationInterface getServiceConfiguration()Gets the service's configuration.- Specified by:
getServiceConfigurationin interfaceRemoteServiceInterface- Returns:
- Service's configuration or
nullif no service configuration is defined.
-
configure
void configure(ServiceConfigurationInterface serviceConfiguration) throws InitializationException, ServiceException Configures the service. Note that this method may used to initialize a service or to re-configure a previously initialized service.An
InitializationExceptionwill 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
ServiceExceptionwill 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 anInitializationExceptionshould be thrown instead of aServiceException.- Specified by:
configurein interfaceRemoteServiceInterface- Parameters:
serviceConfiguration- An object containing configuration data necessary to initialize or re-configure a service. Note that the service must verify that the object type is supported. AnInitializationExceptionshould be thrown if the initialization was not completed successfully to indicate that the instance should not be used.- Throws:
InitializationException- if unable to initialize the service. If this exception is thrown then the service should not be used.ServiceException- if a previously initialized service does not support reconfiguration.
-
getCreationTime
long getCreationTime()Gets the time at which this configuration was created.- Specified by:
getCreationTimein interfaceRemoteServiceInterface- Returns:
- Time the service was created.
-
getServiceState
short getServiceState()Gets the current state of the service. The state will be one of- ServiceState.SERVICE_STATE_UNINITIALIZED
- ServiceState.SERVICE_STATE_INITIALIZED
- ServiceState.SERVICE_STATE_DEACTIVATED
- Specified by:
getServiceStatein interfaceRemoteServiceInterface- Returns:
- Service's state.
-
isAccessibleToRemoteClients
Determines whether or not the service is accessible to remote clients.- Specified by:
isAccessibleToRemoteClientsin interfaceRemoteServiceInterface- Returns:
trueif the service is intended to be accessible to remote clients orfalseif it isn't.- Throws:
ServiceException- if unable to process the request.
-
isExported
Determines whether or not the service has been exported to the RMI system.- Specified by:
isExportedin interfaceRemoteServiceInterface- Returns:
trueif the service has been exported orfalseif it hasn't.- Throws:
ServiceException- if unable to process the request.
-
setServiceState
Sets the state of the service.- Specified by:
setServiceStatein interfaceRemoteServiceInterface- Parameters:
serviceState- Service's state.- Throws:
ServiceException- if an invalid service state is specified.
-
getServiceProxy
RemoteServiceInterface getServiceProxy()Gets the service proxy.- Specified by:
getServiceProxyin interfaceRemoteServiceInterface- Returns:
- A proxy to this service or
nullif a proxy is not available.
-