|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
IntegratedMasterSlaveTest.MasterI | |
IntegratedMasterSlaveTest.SlaveI | |
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. |
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. |
ExecJVM | A utility class to allow executing another JVM. |
ExecJVMTest | Test cases for ExecJVM . |
ExecJVMTest.FileCreator | |
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 4Interrupted while waiting for master JVM to call |
SlaveJVMRunner | This class is used for its main(java.lang.String[]) method, which is used
when a new slave JVM is invoked. |
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 simply invoke a new JVM with no communications links, use
the class ExecJVM
. The rest of this page explains how
to use this framework to create a new JVM and set up bidirectional
communications using RMI. This system runs a second JVM using the same
classpath as the current JVM (by invoking ExecJVM#runJVMPropogateClassPath
).
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
java.rmi.RemoteException.
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
java.rmi.RemoteException.
AbstractMasterJVM
and implement
YourMasterInterface. Note that the super()
call
must pass to AbstractMasterJVM the fully-qualified class name
of the slave JVM implementation.SlaveRemote#quit
,
which is called when the main JVM requests the slave to quit,
and SlaveRemote#start
, which is called when the slave JVM
is started.
Now you can create an instance of your master JVM class and use
its AbstractMasterJVM#invokeSlave
method to start
the slave JVM.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |