KickJava   Java API By Example, From Geeks To Geeks.

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


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.rmi.RemoteException JavaDoc;
37 import java.util.List JavaDoc;
38 import java.io.File JavaDoc;
39
40 import edu.rice.cs.util.newjvm.*;
41 import edu.rice.cs.util.ClassPathVector;
42
43 /**
44  * This interface specifies the methods that the interpreter JVM exposes
45  * for the MainJVM to call.
46  *
47  * @version $Id: InterpreterJVMRemoteI.java 4031 2006-11-15 22:09:06Z rcartwright $
48  */

49 public interface InterpreterJVMRemoteI extends SlaveRemote {
50   
51   public List JavaDoc<String JavaDoc> findTestClasses(List JavaDoc<String JavaDoc> classNames, List JavaDoc<File JavaDoc> files)
52     throws RemoteException JavaDoc;
53   
54   public boolean runTestSuite() throws RemoteException JavaDoc;
55   
56   public void setPackageScope(String JavaDoc s) throws RemoteException JavaDoc;
57   //public void reset() throws RemoteException;
58

59   /**
60    * @param show Whether to show a message if a reset operation fails.
61    */

62   public void setShowMessageOnResetFailure(boolean show) throws RemoteException JavaDoc;
63
64   /**
65    * Adds a named DynamicJavaAdapter to the list of interpreters.
66    * @param name the unique name for the interpreter
67    * @throws IllegalArgumentException if the name is not unique
68    */

69   public void addJavaInterpreter(String JavaDoc name) throws RemoteException JavaDoc;
70
71   /**
72    * Adds a named JavaDebugInterpreter to the list of interpreters.
73    * @param name the unique name for the interpreter
74    * @param className the fully qualified class name of the class
75    * the debug interpreter is in
76    * @throws IllegalArgumentException if the name is not unique
77    */

78   public void addDebugInterpreter(String JavaDoc name, String JavaDoc className) throws RemoteException JavaDoc;
79
80   /**
81    * Removes the interpreter with the given name, if it exists.
82    * @param name Name of the interpreter to remove
83    */

84   public void removeInterpreter(String JavaDoc name) throws RemoteException JavaDoc;
85
86   /** Sets the current interpreter to be the one specified by the given name
87     * @param name the unique name of the interpreter to set active
88     * @return Whether the new interpreter is currently in progress
89     * with an interaction
90     */

91   public boolean setActiveInterpreter(String JavaDoc name) throws RemoteException JavaDoc;
92
93   /** Sets the default interpreter to be active.
94     * @return Whether the new interpreter is currently in progress
95     * with an interaction
96     */

97   public boolean setToDefaultInterpreter() throws RemoteException JavaDoc;
98
99   /** Returns a copy of the list of unique entries on the classpath. */
100   public ClassPathVector getAugmentedClassPath() throws RemoteException JavaDoc;
101
102   /** Gets the string representation of the value of a variable in the current interpreter.
103     * @param var the name of the variable
104     */

105   public String JavaDoc getVariableToString(String JavaDoc var) throws RemoteException JavaDoc;
106
107   /** Gets the class name of a variable in the current interpreter.
108     * @param var the name of the variable
109     */

110   public String JavaDoc getVariableClassName(String JavaDoc var) throws RemoteException JavaDoc;
111
112   /** Sets whether to allow private access. */
113   public void setPrivateAccessible(boolean allow) throws RemoteException JavaDoc;
114
115 // /** Updates the security manager in slave JVM. */
116
// public void enableSecurityManager() throws RemoteException;
117
//
118
// /** Updates the security manager in slave JVM. */
119
// public void disableSecurityManager() throws RemoteException;
120

121   /** Interprets the given string of source code in the active interpreter. The result is returned to MainJVMRemoteI via
122    * the interpretResult method.
123    * @param s Source code to interpret.
124    */

125   public void interpret(String JavaDoc s) throws RemoteException JavaDoc;
126   
127   /** Adds the given path to the classpath shared by ALL Java interpreters. This method <b>cannot</b> take multiple
128    * paths separated by a path separator; it must be called separately for each path. Only unique paths are added.
129    * @param s Entry to add to the accumulated classpath
130    */

131   public void addProjectClassPath(String JavaDoc s) throws RemoteException JavaDoc;
132   
133   /** Adds the given path to the classpath shared by ALL Java interpreters. This method <b>cannot</b> take multiple
134    * paths separated by a path separator; it must be called separately for each path. Only unique paths are added.
135    * @param s Entry to add to the accumulated classpath
136    */

137   public void addBuildDirectoryClassPath(String JavaDoc s) throws RemoteException JavaDoc;
138   
139   /** Adds the given path to the classpath shared by ALL Java interpreters. This method <b>cannot</b> take multiple
140    * paths separated by a path separator; it must be called separately for each path. Only unique paths are added.
141    * @param s Entry to add to the accumulated classpath
142    */

143   public void addProjectFilesClassPath(String JavaDoc s) throws RemoteException JavaDoc;
144   
145   /** Adds the given path to the classpath shared by ALL Java interpreters. This method <b>cannot</b> take multiple
146    * paths separated by a path separator; it must be called separately for each path. Only unique paths are added.
147    * @param s Entry to add to the accumulated classpath
148    */

149   public void addExternalFilesClassPath(String JavaDoc s) throws RemoteException JavaDoc;
150   
151   /** Adds the given path to the classpath shared by ALL Java interpreters. This method <b>cannot</b> take multiple
152    * paths separated by a path separator; it must be called separately for each path. Only unique paths are added.
153    * @param s Entry to add to the accumulated classpath
154    */

155   public void addExtraClassPath(String JavaDoc s) throws RemoteException JavaDoc;
156   
157 }
158
Popular Tags