Package edu.rice.cs.util.newjvm

This package is a system to allow the invocation and control of a new Java virtual machine.

See:
          Description

Interface Summary
IntegratedMasterSlaveTest.TestMasterRemote  
IntegratedMasterSlaveTest.TestSlaveRemote  
MasterRemote The remote interface for a master JVM.
SlaveRemote The remote interface for a slave JVM.
 

Class Summary
AbstractMasterJVM An abstract class implementing the logic to invoke and control, via RMI, a second Java virtual machine.
AbstractMasterJVM.SlaveFactory Loads an instance of the given AbstractSlaveJVM 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.
IntegratedMasterSlaveTest Test cases for the master/slave jvm control framework.
IntegratedMasterSlaveTest.CounterSlave The slave will exit with error codes in the case of problems, since there is no other thing it can do! 1MasterRemote class cast exception. 2Incorect value from getLetter 3RemoteException caught 4Timeout waiting for master JVM to call 5Interrupted while waiting for master JVM to call
IntegratedMasterSlaveTest.TestMasterJVM  
 

Enum Summary
AbstractMasterJVM.State Synchronization strategy: compare-and-swap guarantees that only one thread enters a STARTING, or QUITTING, or DISPOSED state.
 

Package edu.rice.cs.util.newjvm Description

This package is a system to allow the invocation and control of a new Java virtual machine. The two JVMs can communicate by using RMI.

To use these classes:

  1. Create a remote interface that the master JVM will support, extending MasterRemote. This interface must specify of the methods that the slave JVM can call on the master JVM. All methods in this interface must be declared to throw RemoteException
  2. Create a remote interface that the slave JVM will support, extending SlaveRemote. This interface must specify of the methods that the master JVM can call on the slave JVM. All methods in this interface must be declared to throw RemoteException
  3. Create the master JVM implementation, which must extend AbstractMasterJVM and implement YourMasterInterface. Note that the super() call must pass to AbstractMasterJVM the fully-qualified class name of the slave JVM implementation.
  4. Create the slave JVM implementation, which must extend AbstractSlaveJVM and implement YourSlaveInterface.

Now you can create an instance of your master JVM class and use its AbstractMasterJVM.invokeSlave(edu.rice.cs.plt.concurrent.JVMBuilder) method to start the slave JVM.