edu.rice.cs.drjava.model.repl.newjvm
Class InterpreterJVM

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM
All Implemented Interfaces:
InterpreterJVMRemoteI, Remote, Serializable

public class InterpreterJVM
extends UnicastRemoteObject
implements InterpreterJVMRemoteI

This is the main class for the interpreter JVM. Note that this class is specific to using DynamicJava. It would need to be subclassed to use with another interpreter. (Really, there would need to be an abstract base class, but since we don't need it yet I'm not making one.)

Version:
$Id: InterpreterJVM.java,v 1.11 2002/09/13 22:55:34 csreis Exp $
See Also:
Serialized Form

Field Summary
private  String _classpath
           
private  JavaInterpreter _interpreter
           
private  JUnitTestManager _junitTestManager
           
private  MainJVMRemoteI _mainJVM
           
static int CHECK_MAIN_VM_ALIVE_MINUTES
           
static String EMPTY_TRACE_TEXT
           
static int WAIT_UNTIL_QUIT_MS
           
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
InterpreterJVM(String url)
           
 
Method Summary
private static void _dialog(String s)
           
 void addClassPath(String s)
           
 void exitJVM()
           
 String getClasspath()
           
protected static String getStackTrace(Throwable t)
          Gets the stack trace from the given exception, stripping off the bottom parts of the trace that are internal to the interpreter.
 void interpret(String s)
           
static void main(String[] args)
          Main entry point for interpreter JVM.
 void nonTestCase()
           
 void reset()
           
 void runTest(String className, String fileName)
           
 void setPackageScope(String s)
           
 void testFinished(JUnitError[] errors)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
, clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

WAIT_UNTIL_QUIT_MS

public static final int WAIT_UNTIL_QUIT_MS

CHECK_MAIN_VM_ALIVE_MINUTES

public static final int CHECK_MAIN_VM_ALIVE_MINUTES

EMPTY_TRACE_TEXT

public static final String EMPTY_TRACE_TEXT

_mainJVM

private final MainJVMRemoteI _mainJVM

_interpreter

private JavaInterpreter _interpreter

_classpath

private String _classpath

_junitTestManager

private JUnitTestManager _junitTestManager
Constructor Detail

InterpreterJVM

public InterpreterJVM(String url)
               throws RemoteException,
                      NotBoundException,
                      MalformedURLException
Method Detail

interpret

public void interpret(String s)
               throws RemoteException
Specified by:
interpret in interface InterpreterJVMRemoteI

_dialog

private static void _dialog(String s)

getStackTrace

protected static String getStackTrace(Throwable t)
Gets the stack trace from the given exception, stripping off the bottom parts of the trace that are internal to the interpreter. This would be much easier to do in JDK 1.4, since you can get the stack trace frames directly, instead of having to parse this!

exitJVM

public void exitJVM()
             throws RemoteException
Specified by:
exitJVM in interface InterpreterJVMRemoteI

addClassPath

public void addClassPath(String s)
                  throws RemoteException
Specified by:
addClassPath in interface InterpreterJVMRemoteI

getClasspath

public String getClasspath()

runTest

public void runTest(String className,
                    String fileName)
             throws RemoteException
Specified by:
runTest in interface InterpreterJVMRemoteI

nonTestCase

public void nonTestCase()

testFinished

public void testFinished(JUnitError[] errors)

setPackageScope

public void setPackageScope(String s)
                     throws RemoteException
Specified by:
setPackageScope in interface InterpreterJVMRemoteI

reset

public void reset()
           throws RemoteException
Specified by:
reset in interface InterpreterJVMRemoteI

main

public static void main(String[] args)
Main entry point for interpreter JVM.
Parameters:
args - Command-line arguments. #1 must be the URL to find the MainJVMRemoteI via RMI.