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

java.lang.Object
  extended by edu.rice.cs.drjava.model.repl.newjvm.MainJVM.DummyInteractionsModel
All Implemented Interfaces:
InteractionsModelCallback
Enclosing class:
MainJVM

public static class MainJVM.DummyInteractionsModel
extends Object
implements InteractionsModelCallback

InteractionsModel which does not react to events.


Constructor Summary
MainJVM.DummyInteractionsModel()
           
 
Method Summary
 void changeInputListener(InputListener from, InputListener to)
          Changes the input listener.
 String getConsoleInput()
          Called when input is request from System.in.
 int getDebugPort()
          Returns an available port number to use for debugging a remote interpreter.
 void interpreterReady(File wd)
          Called when a new Java interpreter has registered and is ready for use.
 void interpreterResetFailed(Throwable th)
          This method is called by the Main JVM if the Interpreter JVM cannot be exited (likely because of its having a security manager)
 void interpreterResetting()
          Called when the interpreter starts to reset.
 void replCalledSystemExit(int status)
          Signifies that the most recent interpretation contained a call to System.exit.
 void replReturnedResult(String result, String style)
          Signifies that the most recent interpretation completed successfully, returning a value.
 void replReturnedSyntaxError(String errorMessage, String interaction, int startRow, int startCol, int endRow, int endCol)
          Signifies that the most recent interpretation was preempted by a syntax error.
 void replReturnedVoid()
          Signifies that the most recent interpretation completed successfully, returning no value.
 void replSystemErrPrint(String s)
          Called when the repl prints to System.err.
 void replSystemOutPrint(String s)
          Called when the repl prints to System.out.
 void replThrewException(String message)
          Signifies that the most recent interpretation was ended due to an exception being thrown.
 void setInputListener(InputListener il)
          Sets the listener for any type of single-source input event.
 void slaveJVMUsed()
          Called when the slave JVM is used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainJVM.DummyInteractionsModel

public MainJVM.DummyInteractionsModel()
Method Detail

getDebugPort

public int getDebugPort()
                 throws IOException
Description copied from interface: InteractionsModelCallback
Returns an available port number to use for debugging a remote interpreter.

Specified by:
getDebugPort in interface InteractionsModelCallback
Throws:
IOException - if unable to get a valid port number.

replSystemOutPrint

public void replSystemOutPrint(String s)
Description copied from interface: InteractionsModelCallback
Called when the repl prints to System.out.

Specified by:
replSystemOutPrint in interface InteractionsModelCallback
Parameters:
s - String to print

replSystemErrPrint

public void replSystemErrPrint(String s)
Description copied from interface: InteractionsModelCallback
Called when the repl prints to System.err.

Specified by:
replSystemErrPrint in interface InteractionsModelCallback
Parameters:
s - String to print

getConsoleInput

public String getConsoleInput()
Description copied from interface: InteractionsModelCallback
Called when input is request from System.in.

Specified by:
getConsoleInput in interface InteractionsModelCallback
Returns:
the input given to System.in

setInputListener

public void setInputListener(InputListener il)
Description copied from interface: InteractionsModelCallback
Sets the listener for any type of single-source input event. The listener can only be changed with the changeInputListener method.

Specified by:
setInputListener in interface InteractionsModelCallback
Parameters:
il - a listener that reacts to input requests

changeInputListener

public void changeInputListener(InputListener from,
                                InputListener to)
Description copied from interface: InteractionsModelCallback
Changes the input listener. Takes in the old listener to ensure that the owner of the original listener is aware that it is being changed.

Specified by:
changeInputListener in interface InteractionsModelCallback
Parameters:
from - the previous listener
to - the listener to install

replReturnedVoid

public void replReturnedVoid()
Description copied from interface: InteractionsModelCallback
Signifies that the most recent interpretation completed successfully, returning no value.

Specified by:
replReturnedVoid in interface InteractionsModelCallback

replReturnedResult

public void replReturnedResult(String result,
                               String style)
Description copied from interface: InteractionsModelCallback
Signifies that the most recent interpretation completed successfully, returning a value.

Specified by:
replReturnedResult in interface InteractionsModelCallback
Parameters:
result - The .toString-ed version of the value that was returned by the interpretation. We must return the String form because returning the Object directly would require the data type to be serializable.

replThrewException

public void replThrewException(String message)
Description copied from interface: InteractionsModelCallback
Signifies that the most recent interpretation was ended due to an exception being thrown.

Specified by:
replThrewException in interface InteractionsModelCallback
Parameters:
message - The exception's message

replReturnedSyntaxError

public void replReturnedSyntaxError(String errorMessage,
                                    String interaction,
                                    int startRow,
                                    int startCol,
                                    int endRow,
                                    int endCol)
Description copied from interface: InteractionsModelCallback
Signifies that the most recent interpretation was preempted by a syntax error.

Specified by:
replReturnedSyntaxError in interface InteractionsModelCallback
Parameters:
errorMessage - The syntax error message
startRow - The starting row of the error
startCol - The starting column of the error
endRow - The end row of the error
endCol - The end column of the error

replCalledSystemExit

public void replCalledSystemExit(int status)
Description copied from interface: InteractionsModelCallback
Signifies that the most recent interpretation contained a call to System.exit.

Specified by:
replCalledSystemExit in interface InteractionsModelCallback
Parameters:
status - The exit status that will be returned.

interpreterResetting

public void interpreterResetting()
Description copied from interface: InteractionsModelCallback
Called when the interpreter starts to reset.

Specified by:
interpreterResetting in interface InteractionsModelCallback

interpreterResetFailed

public void interpreterResetFailed(Throwable th)
Description copied from interface: InteractionsModelCallback
This method is called by the Main JVM if the Interpreter JVM cannot be exited (likely because of its having a security manager)

Specified by:
interpreterResetFailed in interface InteractionsModelCallback
Parameters:
th - The Throwable thrown by System.exit

interpreterReady

public void interpreterReady(File wd)
Description copied from interface: InteractionsModelCallback
Called when a new Java interpreter has registered and is ready for use.

Specified by:
interpreterReady in interface InteractionsModelCallback

slaveJVMUsed

public void slaveJVMUsed()
Description copied from interface: InteractionsModelCallback
Called when the slave JVM is used

Specified by:
slaveJVMUsed in interface InteractionsModelCallback