|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Note: Service's Serializable interface should be honored, because Serialization is the basic means of exchange between JVMs in RMI calls, and if a Service is not Serializable then it cannot be transferred across JVMs.
If a Service needs to maintain "interim" data that should not
be Serialized, then remember to mark the data members as
transient
. Also, remember that a given Serializable
class can control what happens when it is serialized and
deserialized by means of thewriteObject and readObject methods.
This would allow, for example, those Services that make use of
JDBC Connections (as an example) to close down and reopen the
Connection upon serialization and subsequent deserialization.
Field Summary | |
static java.lang.String |
PAUSED
|
static java.lang.String |
PAUSING
|
static java.lang.String |
RESUMING
|
static java.lang.String |
RUNNING
|
static java.lang.String |
STARTING
|
static java.lang.String |
STOPPED
|
static java.lang.String |
STOPPING
|
Method Summary | |
ConfigProperties |
getConfigInfo()
Return the Properties configuration information |
java.lang.String |
getInstanceID()
Return a String uniquely identifying this instance of the Service; this String must be unique not just to the Service class, but to the Service instance itself. |
java.lang.String |
getState()
Get the current state of the Service; must be one of the following types: STOPPED, STARTING, RUNNING, STOPPING, PAUSING, PAUSED, or RESUMING. |
void |
pause()
Pause the Service. |
void |
resume()
Resume the Service. |
void |
setConfigInfo(ConfigProperties info)
Set the Properties configuration information |
void |
start()
Start the Service. |
void |
stop()
Stop the Service. |
Field Detail |
public static final java.lang.String STOPPED
public static final java.lang.String STARTING
public static final java.lang.String RUNNING
public static final java.lang.String STOPPING
public static final java.lang.String PAUSING
public static final java.lang.String PAUSED
public static final java.lang.String RESUMING
Method Detail |
public void start() throws java.lang.Exception
public void stop() throws java.lang.Exception
public void pause() throws java.lang.Exception
public void resume() throws java.lang.Exception
public java.lang.String getState()
public java.lang.String getInstanceID() throws java.lang.Exception
String instanceID = this.getClass().getName() + ":" +
getClassVersion() + ":" + System.currentTimeMillis();
Note that maintaining an "instance count" of the number of
instances of this class will fail, since all instances will
be maintained within their own ClassLoader, and static
members are stored on a per-ClassLoader basis.public ConfigProperties getConfigInfo()
public void setConfigInfo(ConfigProperties info)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |