edu.rice.cs.drjava.model.repl.newjvm
Class MainJVM.State

java.lang.Object
  extended by edu.rice.cs.drjava.model.repl.newjvm.MainJVM.State
Direct Known Subclasses:
MainJVM.DisposedState, MainJVM.FreshState, MainJVM.RestartingState, MainJVM.RunningState, MainJVM.StartingState, MainJVM.StoppingState
Enclosing class:
MainJVM

private abstract class MainJVM.State
extends Object

State-based implementation of the starting/stopping functionality.


Constructor Summary
private MainJVM.State()
           
 
Method Summary
abstract  void dispose()
           
abstract  InterpreterJVMRemoteI interpreter(boolean used)
          Get the current interpreter -- null if unavailable.
abstract  void restart(boolean force)
          Ensure that the interpreter is stopping or not running, to be started again.
abstract  void start()
          Ensure that the interpreter is starting or running.
 void started(InterpreterJVMRemoteI i)
          React to a completed startup.
 void startFailed(Exception e)
          React to a failed startup.
abstract  void stop()
          Ensure that the interpreter is stopping or not running.
 void stopped(int status)
          React to a completed shutdown (requested or spontaneous).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainJVM.State

private MainJVM.State()
Method Detail

interpreter

public abstract InterpreterJVMRemoteI interpreter(boolean used)
Get the current interpreter -- null if unavailable. Block if necessary.

Parameters:
used - Whether this access will lead to a used JVM -- one that should be reset even when not forced

start

public abstract void start()
Ensure that the interpreter is starting or running. Block if necessary.


stop

public abstract void stop()
Ensure that the interpreter is stopping or not running. Block if necessary.


restart

public abstract void restart(boolean force)
Ensure that the interpreter is stopping or not running, to be started again. Block if necessary.

Parameters:
force - Whether an unused, running JVM should be restarted

dispose

public abstract void dispose()

started

public void started(InterpreterJVMRemoteI i)
React to a completed startup.


startFailed

public void startFailed(Exception e)
React to a failed startup.


stopped

public void stopped(int status)
React to a completed shutdown (requested or spontaneous).