|
||||||||||
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 | |
---|---|
protected static Log |
_log
|
protected String |
_pollMasterThreadName
Name of the thread to periodically poll the master. |
protected String |
_quitSlaveThreadName
Name of the thread to quit the slave. |
static int |
CHECK_MAIN_VM_ALIVE_SECONDS
|
Constructor Summary | |
---|---|
AbstractSlaveJVM()
|
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. |
protected void |
quitFailed(Throwable th)
This method is called if the interpreterJVM cannot be exited (likely because of a unexpected security manager.) |
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
protected static final Log _log
protected volatile String _quitSlaveThreadName
protected volatile String _pollMasterThreadName
Constructor Detail |
---|
public AbstractSlaveJVM() throws RemoteException
RemoteException
Method Detail |
---|
public final void quit()
beforeQuit()
before it does.
quit
in interface SlaveRemote
protected void beforeQuit()
protected void quitFailed(Throwable th)
public final void start(MasterRemote master) throws RemoteException
handleStart(edu.rice.cs.util.newjvm.MasterRemote)
); and
(iii) this method (and perhaps handleStart(edu.rice.cs.util.newjvm.MasterRemote)
) perform remote calls on master.
This method delegates starting actions other than polling master to handleStart(edu.rice.cs.util.newjvm.MasterRemote)
.
start
in interface SlaveRemote
master
- 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. Also note that because of the GJ erasure
semantics, this can't have the type it, which is MasterRemoteRemoteException
protected abstract void handleStart(MasterRemote master)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |