| java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject edu.rice.cs.util.newjvm.AbstractMasterJVM
All known Subclasses: edu.rice.cs.drjava.model.repl.newjvm.MainJVM,
AbstractMasterJVM | abstract public class AbstractMasterJVM extends UnicastRemoteObject implements MasterRemote(Code) | | 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.)
This class runs in both the master and the slave JVMs.
version: $Id: AbstractMasterJVM.java 4255 2007-08-28 19:17:37Z mgricken $ |
Field Summary | |
final public static Log | _log | final protected Object | _masterJVMLock Lock for accessing the critical state of this AbstractMasterJVM including _monitorThread. | protected volatile SlaveRemote | _slave The slave JVM remote stub if it's connected; null if not connected. | protected volatile String | _waitForQuitThreadName Name for the thread that waits for the slave to exit. |
Constructor Summary | |
protected | AbstractMasterJVM(String slaveClassName) Sets up the master JVM object, but does not actually invoke the slave JVM.
Parameters: slaveClassName - The fully-qualified class name of the class to start up in the second JVM. |
_masterJVMLock | final protected Object _masterJVMLock(Code) | | Lock for accessing the critical state of this AbstractMasterJVM including _monitorThread.
|
_slave | protected volatile SlaveRemote _slave(Code) | | The slave JVM remote stub if it's connected; null if not connected.
|
_waitForQuitThreadName | protected volatile String _waitForQuitThreadName(Code) | | Name for the thread that waits for the slave to exit.
|
AbstractMasterJVM | protected AbstractMasterJVM(String slaveClassName) throws RemoteException(Code) | | Sets up the master JVM object, but does not actually invoke the slave JVM.
Parameters: 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. |
checkStillAlive | public void checkStillAlive()(Code) | | No-op to prove that the master is still alive.
|
errorStartingSlave | abstract public void errorStartingSlave(Throwable cause) throws RemoteException(Code) | | Called if the slave JVM dies before it is able to register.
Parameters: cause - The Throwable which caused the slave to die. |
getSlave | final protected SlaveRemote getSlave()(Code) | | Returns slave remote instance, or null if not connected.
|
handleSlaveConnected | abstract protected void handleSlaveConnected()(Code) | | Callback for when the slave JVM has connected, and the bidirectional communications link has been
established. During this call,
AbstractMasterJVM.getSlave is guaranteed to not return null.
|
handleSlaveQuit | abstract protected void handleSlaveQuit(int status)(Code) | | Callback for when the slave JVM has quit. During this call,
AbstractMasterJVM.getSlave is guaranteed to return null.
Parameters: status - The exit code returned by the slave JVM. |
invokeSlave | final protected void invokeSlave(String[] jvmArgs, File workDir) throws IOException, RemoteException(Code) | | Invokes slave JVM, using the system classpath.
Parameters: jvmArgs - Array of arguments to pass to the JVM on startUp throws: IllegalStateException - if slave JVM already connected or startUp is in progress. |
invokeSlave | final protected void invokeSlave(String[] jvmArgs, String cp, File workDir) throws IOException, RemoteException(Code) | | Creates and invokes slave JVM.
Parameters: jvmArgs - Array of arguments to pass to the JVM on startUp Parameters: cp - Classpath to use when starting the JVM throws: IllegalStateException - if slave JVM already connected or startUp is in progress. |
isStartupInProgress | protected boolean isStartupInProgress()(Code) | | Returns true if the slave is in the process of starting.
|
slaveQuitDuringStartup | protected void slaveQuitDuringStartup(int status)(Code) | | Action to take if the slave JVM quits before registering. Assumes _masterJVMLock is held.
Parameters: status - Status code of the JVM |
waitSlaveDone | public void waitSlaveDone()(Code) | | Waits until no slave JVM is running under control of "this"
|
|
|