KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > repl > newjvm > MainJVMRemoteI


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2005 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.model.repl.newjvm;
35
36 import java.io.File JavaDoc;
37 import java.rmi.RemoteException JavaDoc;
38 import edu.rice.cs.util.newjvm.*;
39 import edu.rice.cs.drjava.model.junit.JUnitError;
40 import edu.rice.cs.util.classloader.ClassFileError;
41
42 /**
43  * This interface specifies the methods that the Main JVM exposes
44  * for the InterpreterJVM to call.
45  *
46  * @version $Id: MainJVMRemoteI.java 3553 2006-02-20 21:22:09Z rcartwright $
47  */

48 public interface MainJVMRemoteI extends MasterRemote {
49   
50   /**
51    * Forwards a call to System.err from InterpreterJVM to the
52    * MainJVM for output to the user.
53    * @param s String that was printed in the other JVM
54    */

55   public void systemErrPrint(String JavaDoc s) throws RemoteException JavaDoc;
56   
57   /**
58    * Forwards a call to System.out from InterpreterJVM to the
59    * MainJVM for output to the user.
60    * @param s String that was printed in the other JVM
61    */

62   public void systemOutPrint(String JavaDoc s) throws RemoteException JavaDoc;
63
64   /**
65    * Called when a call to interpret has completed.
66    * @param result The result of the interpretation
67    */

68   public void interpretResult(InterpretResult result) throws RemoteException JavaDoc;
69
70   /** This method is called by the interpreter JVM if it cannot be exited (likely because of its having a security
71    * manager)
72    * @param th The Throwable thrown by System.exit
73    */

74   public void quitFailed(Throwable JavaDoc th) throws RemoteException JavaDoc;
75
76   /** Called if JUnit is invoked on a non TestCase class.
77    * @param isTestAll whether or not it was a use of the test all button
78    */

79   public void nonTestCase(boolean isTestAll) throws RemoteException JavaDoc;
80
81   /** Called if the slave JVM encounters an illegal class file during testing.
82    * @param e the ClassFileError object describing the error when loading the class file.
83    */

84   public void classFileError(ClassFileError e) throws RemoteException JavaDoc;
85   
86   /** Called to indicate that a suite of tests has started running.
87    * @param numTests The number of tests in the suite to be run.
88    */

89   public void testSuiteStarted(int numTests) throws RemoteException JavaDoc;
90
91   /** Called when a particular test is started.
92    * @param testName The name of the test being started.
93    */

94   public void testStarted(String JavaDoc testName) throws RemoteException JavaDoc;
95
96   /** Called when a particular test has ended.
97    * @param testName The name of the test that has ended.
98    * @param wasSuccessful Whether the test passed or not.
99    * @param causedError If not successful, whether the test caused an error
100    * or simply failed.
101    */

102   public void testEnded(String JavaDoc testName, boolean wasSuccessful, boolean causedError)
103     throws RemoteException JavaDoc;
104
105   /**
106    * Called when a full suite of tests has finished running.
107    * @param errors The array of errors from all failed tests in the suite.
108    */

109   public void testSuiteEnded(JUnitError[] errors) throws RemoteException JavaDoc;
110
111   /**
112    * Called when the JUnitTestManager wants to open a file that is not currently open.
113    * @param className the name of the class for which we want to find the file
114    * @return the file associated with the given class
115    */

116   public File JavaDoc getFileForClassName(String JavaDoc className) throws RemoteException JavaDoc;
117
118   /**
119    * Notifies the main jvm that an assignment has been made in the given debug
120    * interpreter.
121    * Does not notify on declarations.
122    *
123    * This method is not currently necessary, since we don't copy back
124    * values in a debug interpreter until the thread has resumed.
125    *
126    * @param name the name of the debug interpreter
127    *
128   public void notifyDebugInterpreterAssignment(String name) throws RemoteException;
129   */

130
131   /**
132    * Asks the main jvm for input from the console.
133    * @return the console input
134    */

135   public String JavaDoc getConsoleInput() throws RemoteException JavaDoc;
136 }
137
Popular Tags