KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > debug > eval > IClassFileEvaluationEngine


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.debug.eval;
12
13 import org.eclipse.debug.core.DebugException;
14 import org.eclipse.jdt.debug.core.IJavaThread;
15
16
17 /**
18  * An evaluation engine that performs evaluations by
19  * deploying and executing class files locally.
20  * <p>
21  * Clients are not intended to implement this interface.
22  * </p>
23  * @since 2.0
24  */

25 public interface IClassFileEvaluationEngine extends IEvaluationEngine {
26     /**
27      * Returns the import declarations for this evaluation context. An empty
28      * list indicates there are no imports. The syntax for the import corresponds to a
29      * fully qualified type name, or to an on-demand package name as defined by
30      * ImportDeclaration (JLS2 7.5). For example, <code>"java.util.Hashtable"</code>
31      * or <code>"java.util.*"</code>.
32      *
33      * @return the list of import names
34      */

35     public String JavaDoc[] getImports();
36     
37     /**
38      * Sets the import declarations for this evaluation context. An empty
39      * list indicates there are no imports. The syntax for the import corresponds to a
40      * fully qualified type name, or to an on-demand package name as defined by
41      * ImportDeclaration (JLS2 7.5). For example, <code>"java.util.Hashtable"</code>
42      * or <code>"java.util.*"</code>.
43      *
44      * @param imports the list of import names
45      */

46     public void setImports(String JavaDoc[] imports);
47         
48     /**
49      * Asynchronously evaluates the given snippet in the specified
50      * target thread, reporting the result back to the given listener.
51      * The snippet is evaluated in the context of the Java
52      * project this evaluation engine was created on. If the
53      * snippet is determined to be a valid expression, the expression
54      * is evaluated in the specified thread, which resumes its
55      * execution from the location at which it is currently suspended.
56      * When the evaluation completes, the thread will be suspened
57      * at this original location.
58      * Compilation and runtime errors are reported in the evaluation result.
59      *
60      * @param snippet code snippet to evaluate
61      * @param thread the thread in which to run the evaluation,
62      * which must be suspended
63      * @param listener the listener that will receive notification
64      * when/if the evalaution completes
65      * @param hitBreakpoints whether or not breakpoints should be honored
66      * in the evaluation thread during the evaluation. If <code>false</code>,
67      * breakpoints hit in the evaluation thread will be ignored.
68      * @exception DebugException if this method fails. Reasons include:<ul>
69      * <li>Failure communicating with the VM. The DebugException's
70      * status code contains the underlying exception responsible for
71      * the failure.</li>
72      * <li>The specified thread is not currently suspended</li>
73      * <li>The specified thread is not contained in the debug target
74      * associated with this evaluation engine</li>
75      * <li>The specified thread is suspended in the middle of
76      * an evaluation that has not completed. It is not possible
77      * to perform nested evaluations</li>
78      * </ul>
79      */

80     public void evaluate(String JavaDoc snippet, IJavaThread thread, IEvaluationListener listener, boolean hitBreakpoints) throws DebugException;
81     
82     
83 }
84
85
Popular Tags