|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rice.cs.util.newjvm.AbstractMasterJVM
An abstract class implementing the logic to invoke and control, via RMI, a second Java virtual machine. This class is used by subclassing it. (See package documentation for more details.)
Field Summary | |
private boolean |
_quitOnStartup
This flag is set when a quit request is issued before the slave has even finished starting up. |
private SlaveRemote |
_slave
The slave JVM remote stub, if it's connected, or null if not. |
private String |
_slaveClassName
The fully-qualified name of the slave JVM class. |
private boolean |
_startupInProgress
Is slave JVM in the progress of starting up? |
private Remote |
_stub
The current remote stub for this main JVM object. |
private File |
_stubFile
The file containing the serialized remote stub. |
private static String |
RUNNER
|
Constructor Summary | |
protected |
AbstractMasterJVM(String slaveClassName)
Sets up the master JVM object, but does not actually invoke the slave JVM. |
Method Summary | |
void |
checkStillAlive()
No-op to prove that the master is still alive. |
protected SlaveRemote |
getSlave()
Returns slave remote instance, or null if not connected. |
protected abstract void |
handleSlaveConnected()
Callback for when the slave JVM has connected, and the bidirectional communications link has been established. |
protected abstract void |
handleSlaveQuit(int status)
Callback for when the slave JVM has quit. |
protected void |
invokeSlave()
Invokes slave JVM. |
protected boolean |
isStartupInProgress()
Returns true if the slave is in the process of starting. |
protected void |
quitSlave()
Quits slave JVM. |
void |
registerSlave(SlaveRemote slave)
Registers a slave JVM. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final String RUNNER
private SlaveRemote _slave
private boolean _startupInProgress
private boolean _quitOnStartup
private Remote _stub
private File _stubFile
private final String _slaveClassName
Constructor Detail |
protected AbstractMasterJVM(String slaveClassName)
slaveClassName
- The fully-qualified class name of the
class to start up in the second JVM. This class must implement
the interface specified by this class's type parameter, which
must be a subclass of SlaveRemote
.Method Detail |
protected abstract void handleSlaveConnected()
getSlave()
is guaranteed to not
return null.protected abstract void handleSlaveQuit(int status)
getSlave()
is guaranteed to
return null.status
- The exit code returned by the slave JVM.protected final void invokeSlave() throws IOException, RemoteException
IllegalStateException
- if slave JVM already connected or
startup is in progress.public void checkStillAlive()
checkStillAlive
in interface MasterRemote
public void registerSlave(SlaveRemote slave) throws RemoteException
MasterRemote
registerSlave
in interface MasterRemote
protected final void quitSlave() throws RemoteException
IllegalStateException
- if no slave JVM is connectedprotected final SlaveRemote getSlave()
protected boolean isStartupInProgress()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |