|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteServiceInterface
Interface used to designate a service that is capable of servicing clients that operate outside of the JVM process in which a service was instantiated. It is also the base interface implemented by all services.
It is envisioned that the typical service will have a service configuration which may be associated with other ancillary service configurations to detail a deployment context or disocvery context. The service implementor is free to define any additional service configurations. Note that a service is not required to have a service configuration.
Services will be initialized or reconfigured using the
RemoteServiceInterface.configure(ServiceConfigurationInterface)
method.
The RemoteServiceInterface.destroy()
method is intended to be used to
notify a service that it is being destroyed so that it may perform any
housekeeping necesssary to release resources, etc. Once the destroy method
has been invoked, the service should no longer be used.
A service should directly implement this interface if it is remoteable and is intended to be deployed in a distributed environment.
This interface is extended by
com.sas.services.ServiceInterface
.
ServiceInterface
provides a version that may be used
locally within a JVM process. Unlike RemoteServiceInterface
its
methods do not throw RemoteException
.
ServiceInterface
Field Summary | |
---|---|
static java.lang.String |
CLASS_IDENTIFIER
The metadata element ClassIdentifier designating a
ServiceComponent metadata element as one that is a
foundation service developed using the current API. |
static java.lang.String |
CLASS_IDENTIFIER_1_1
The metadata element ClassIdentifier designating a
ServiceComponent metadata element as one that is a Java
foundation service using the 1.1 API. |
static java.lang.String |
CLASS_IDENTIFIER_1_2
The metadata element ClassIdentifier designating a
ServiceComponent metadata element as one that is a
foundation service developed using the 1.2 API. |
static java.lang.String |
CLASS_IDENTIFIER_SERVICE_TYPE
The metadata element ClassIdentifier designating a
ServiceComponent metadata element as one that is a
foundation service developed using the current API. |
static java.lang.String |
CLASS_IDENTIFIER_SERVICE_TYPE_1_1
ClassIdentifier used to lookup a prototype ServiceType for
an interface implemented by a foundation service developed against
the 1.1 API. |
static java.lang.String |
CLASS_IDENTIFIER_SERVICE_TYPE_1_2
The metadata element ClassIdentifier designating a
ServiceComponent metadata element as one that is a
foundation service developed using the 1.2 API. |
Method Summary | |
---|---|
void |
configure(ServiceConfigurationInterface serviceConfiguration)
Configures the service. |
void |
destroy()
Destroys the service. |
long |
getCreationTime()
Gets the time at which this service was created. |
ServiceConfigurationInterface |
getServiceConfiguration()
Gets the service's configuration. |
ServiceConfigurationInterface |
getServiceConfiguration(java.lang.Object key)
Gets the service's configuration associated with the specified lookup key. |
RemoteServiceInterface |
getServiceProxy()
Gets the service proxy. |
short |
getServiceState()
Gets the current state of the service. |
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 |
reconfigure(ServiceConfigurationInterface serviceConfiguration)
Reconfigure the service. |
void |
setServiceState(ServiceState serviceState)
Sets the state of the service. |
Methods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface |
---|
addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver |
Field Detail |
---|
static final java.lang.String CLASS_IDENTIFIER_SERVICE_TYPE_1_1
ServiceType
for
an interface implemented by a foundation service developed against
the 1.1 API.
static final java.lang.String CLASS_IDENTIFIER_SERVICE_TYPE_1_2
ClassIdentifier
designating a
ServiceComponent
metadata element as one that is a
foundation service developed using the 1.2 API.
static final java.lang.String CLASS_IDENTIFIER_SERVICE_TYPE
ClassIdentifier
designating a
ServiceComponent
metadata element as one that is a
foundation service developed using the current API.
static final java.lang.String CLASS_IDENTIFIER_1_1
ClassIdentifier
designating a
ServiceComponent
metadata element as one that is a Java
foundation service using the 1.1 API.
static final java.lang.String CLASS_IDENTIFIER_1_2
ClassIdentifier
designating a
ServiceComponent
metadata element as one that is a
foundation service developed using the 1.2 API.
static final java.lang.String CLASS_IDENTIFIER
ClassIdentifier
designating a
ServiceComponent
metadata element as one that is a
foundation service developed using the current API.
Method Detail |
---|
ServiceConfigurationInterface getServiceConfiguration() throws java.rmi.RemoteException
null
.
null
if no service
configuration is defined.
Note that a service configuration may
be associated with other ancillary service configurations.
ServiceConfigurationInterface.getServiceConfigurations()
may
be used to obtain an iterator of associated service configurations.
ServiceConfigurationInterface.getServiceConfiguration(Object)
may
be used to obtain a service configuration based upon a known
lookup key.
java.rmi.RemoteException
- if a network anomaly occurs.ServiceConfigurationInterface getServiceConfiguration(java.lang.Object key) throws java.rmi.RemoteException
null
.
key
- Lookup key for the desired service configuration.
null
if no service
configuration is defined.
java.rmi.RemoteException
- if a network anomaly occurs.void configure(ServiceConfigurationInterface serviceConfiguration) throws InitializationException, java.rmi.RemoteException, ServiceException
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
.
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.
An InitializationException
should be thrown if
the initialization was not completed successfully to indicate that
the instance should not be used.
InitializationException
- if unable to initialize the service.
If this exception is thrown then the
service should not be used.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if a previously initialized service
does not support reconfiguration.void reconfigure(ServiceConfigurationInterface serviceConfiguration) throws ServiceException, java.rmi.RemoteException
Since the configure method provides one-time functionality such as exporting and adding shutdown hooks, this method should be used in lieu of the configure method to re-configure a service.
serviceConfiguration
- An object containing configuration data
necessary to re-configure a service.
ServiceException
- if unable to re-configure the service.
java.rmi.RemoteException
- if a network anomaly is encountered.void destroy() throws ServiceException, java.rmi.RemoteException
The service should release any resources it holds in preparation for termination of use of this service.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if the service is unable to prepare itself
for destruction.short getServiceState() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.void setServiceState(ServiceState serviceState) throws ServiceException, java.rmi.RemoteException
serviceState
- Service's state.
ServiceException
- if an invalid service state is specified.
java.rmi.RemoteException
- if a network anomaly is encountered.long getCreationTime() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.boolean isExported() throws ServiceException, java.rmi.RemoteException
true
if the service has been exported or
false
if it hasn't.
ServiceException
- if unable to process the request.
java.rmi.RemoteException
- if a network anomaly occurs.boolean isAccessibleToRemoteClients() throws ServiceException, java.rmi.RemoteException
true
if the service is intended to be accessible
to remote clients or
false
if it isn't.
ServiceException
- if unable to process the request.
java.rmi.RemoteException
- if a network anomaly occurs.RemoteServiceInterface getServiceProxy() throws java.rmi.RemoteException
null
if a proxy is not available.
java.rmi.RemoteException
- if a network anomaly is encountered.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |