|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.util.newjvm.AbstractSlaveJVM
public abstract class AbstractSlaveJVM
A partial implementation of a SlaveRemote that provides the quit functionality and that also periodically
checks if the master is still alive and automatically quits if not.
| Field Summary | |
|---|---|
private String |
_pollMasterThreadName
Name of the thread to periodically poll the master. |
private String |
_quitSlaveThreadName
Name of the thread to quit the slave. |
private boolean |
_started
|
static int |
CHECK_MAIN_VM_ALIVE_SECONDS
|
| Constructor Summary | |
|---|---|
AbstractSlaveJVM()
|
|
AbstractSlaveJVM(String quitSlaveThreadName,
String pollMasterThreadName)
|
|
| Method Summary | |
|---|---|
protected void |
beforeQuit()
This method is called just before the JVM is quit. |
protected abstract void |
handleStart(MasterRemote master)
Called when the slave JVM has started running. |
void |
quit()
Quits the slave JVM, calling beforeQuit() before it does. |
void |
start(MasterRemote master)
Initializes the Slave JVM including starting background thread to periodically poll the master JVM and automatically quit if it's dead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CHECK_MAIN_VM_ALIVE_SECONDS
private final String _quitSlaveThreadName
private final String _pollMasterThreadName
private boolean _started
| Constructor Detail |
|---|
public AbstractSlaveJVM()
public AbstractSlaveJVM(String quitSlaveThreadName,
String pollMasterThreadName)
| Method Detail |
|---|
public final void quit()
beforeQuit() before it does.
quit in interface SlaveRemote
public final void start(MasterRemote master)
throws RemoteException
start in interface SlaveRemotemaster - The remote link to the master JVM. Note that the implementation of the slave class will have to
downcast this reference to the correct master remote interface.
RemoteExceptionprotected void beforeQuit()
protected abstract void handleStart(MasterRemote master)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||