edu.rice.cs.util.newjvm
Class AbstractSlaveJVM

java.lang.Object
  |
  +--edu.rice.cs.util.newjvm.AbstractSlaveJVM
All Implemented Interfaces:
Remote, SlaveRemote
Direct Known Subclasses:
IntegratedMasterSlaveTest.CounterSlave

public abstract class AbstractSlaveJVM
extends Object
implements SlaveRemote

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.

Version:
$Id: AbstractSlaveJVM.java,v 1.3 2002/04/14 16:41:52 brianstoler Exp $

Field Summary
static int CHECK_MAIN_VM_ALIVE_MINUTES
           
 
Constructor Summary
AbstractSlaveJVM()
           
 
Method Summary
protected  void beforeQuit()
          This method is called just before the JVM is quit.
protected abstract  void handleStart(MasterRemote master)
           
 void quit()
          Quits the slave JVM, calling beforeQuit() before it does.
 void start(MasterRemote master)
          Starts 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, registerNatives, toString, wait, wait, wait
 

Field Detail

CHECK_MAIN_VM_ALIVE_MINUTES

public static final int CHECK_MAIN_VM_ALIVE_MINUTES
Constructor Detail

AbstractSlaveJVM

public AbstractSlaveJVM()
Method Detail

quit

public final void quit()
Quits the slave JVM, calling beforeQuit() before it does.
Specified by:
quit in interface SlaveRemote

beforeQuit

protected void beforeQuit()
This method is called just before the JVM is quit. It can be overridden to provide cleanup code, etc.

start

public final void start(MasterRemote master)
                 throws RemoteException
Starts background thread to periodically poll the master JVM and automatically quit if it's dead. It delegates the actual start to handleStart(edu.rice.cs.util.newjvm.MasterRemote).
Specified by:
start in interface SlaveRemote
Following copied from interface: edu.rice.cs.util.newjvm.SlaveRemote
Parameters:
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 ote that because of the GJ erasure semantics, this can't have the type it, which is MasterRemote. Luckily it doesn't matter much here to use the erased type.

handleStart

protected abstract void handleStart(MasterRemote master)