KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > debug > core > IJavaObject


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.core;
12
13
14 import org.eclipse.debug.core.DebugException;
15
16 /**
17  * A value referencing an object on a target VM.
18  * <p>
19  * Clients are not intended to implement this interface.
20  * </p>
21  * @see IJavaValue
22  * @since 2.0
23  */

24 public interface IJavaObject extends IJavaValue {
25     
26     /**
27      * Returns the result of sending the specified message to this object
28      * with the given arguments in the specified thread. The given
29      * thread is resumed to perform the method invocation. The thread will suspend
30      * in its original location when the method invocation is complete. This
31      * method does not return until the method invocation is complete.
32      * Invoking a method in the target VM can result in breakpoints being
33      * hit, infinite loops, and deadlock.
34      *
35      * @param selector the selector of the method to be invoked
36      * @param signature the JNI style signature of the method to be invoked
37      * @param args the arguments of the method, which can be
38      * <code>null</code> or empty if there are none
39      * @param thread the thread in which to invoke the method
40      * @param superSend <code>true</code> if the method lookup should
41      * begin in this object's superclass
42      * @return the result of invoking the method
43      * @exception DebugException if this method fails. Reasons include:<ul>
44      * <li>Failure communicating with the VM. The DebugException's
45      * status code contains the underlying exception responsible for
46      * the failure.</li>
47      * <li>This object does not implement the specified method</li>
48      * <li>An exception occurs while invoking the specified method</li>
49      * <li>The given thread is already performing a message send,
50      * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
51      * <li>The given thread is not currently suspended
52      * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
53      * <li>The given thread was explicitly suspended
54      * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
55      * </ul>
56      */

57     public IJavaValue sendMessage(String JavaDoc selector, String JavaDoc signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException;
58     /**
59      * Returns the result of sending the specified message on the specified declaring type
60      * to this object with the given arguments in the specified thread. The given
61      * thread is resumed to perform the method invocation. The thread will suspend
62      * in its original location when the method invocation is complete. This
63      * method does not return until the method invocation is complete.
64      * Invoking a method in the target VM can result in breakpoints being
65      * hit, infinite loops, and deadlock.
66      *
67      * @param selector the selector of the method to be invoked
68      * @param signature the JNI style signature of the method to be invoked
69      * @param args the arguments of the method, which can be
70      * <code>null</code> or empty if there are none
71      * @param thread the thread in which to invoke the method
72      * @param typeSignature the signature of the type in which the method
73      * is defined or <code>null</code> if the method should be invoked normally using
74      * polymorphism
75      * @return the result of invoking the method
76      * @exception DebugException if this method fails. Reasons include:<ul>
77      * <li>Failure communicating with the VM. The DebugException's
78      * status code contains the underlying exception responsible for
79      * the failure.</li>
80      * <li>This object does not implement the specified method</li>
81      * <li>An exception occurs while invoking the specified method</li>
82      * <li>The given thread is already performing a message send,
83      * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
84      * <li>The given thread is not currently suspended
85      * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
86      * <li>The given thread was explicitly suspended
87      * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
88      * </ul>
89      * @since 2.0.1
90      */

91     public IJavaValue sendMessage(String JavaDoc selector, String JavaDoc signature, IJavaValue[] args, IJavaThread thread, String JavaDoc typeSignature) throws DebugException;
92     /**
93      * Returns a variable representing the field in this object
94      * with the given name, or <code>null</code> if there is no
95      * field with the given name, or the name is ambiguous.
96      *
97      * @param name field name
98      * @param superField whether or not to get the field in the superclass
99      * of this objects.
100      * @return the variable representing the field, or <code>null</code>
101      * @exception DebugException if this method fails. Reasons include:
102      * <ul><li>Failure communicating with the VM. The DebugException's
103      * status code contains the underlying exception responsible for
104      * the failure.</li>
105      */

106     public IJavaFieldVariable getField(String JavaDoc name, boolean superField) throws DebugException;
107     /**
108      * Returns a variable representing the field in this object
109      * with the given name declared in the type with the given
110      * signature, or <code>null</code> if there is no
111      * field with the given name, or the name is ambiguous.
112      *
113      * @param name field name
114      * @param typeSignature the signature of the type in which the field
115      * is defined
116      * @return the variable representing the field, or <code>null</code>
117      * @exception DebugException if this method fails. Reasons include:
118      * <ul><li>Failure communicating with the VM. The DebugException's
119      * status code contains the underlying exception responsible for
120      * the failure.</li>
121      */

122     public IJavaFieldVariable getField(String JavaDoc name, String JavaDoc typeSignature) throws DebugException;
123     
124     /**
125      * Returns the threads waiting for the monitor associated to this object, or
126      * <code>null</code> if no thread is waiting for the monitor.
127      *
128      * @return the thread waiting for the monitor, or <code>null</code>.
129      * @exception DebugException if this method fails. Reasons include:
130      * <ul><li>The VM is not able to retrieve the monitor information</li>
131      * <li>Failure communicating with the VM. The DebugException's
132      * status code contains the underlying exception responsible for
133      * the failure.</li></ul>
134      * @since 3.1
135      */

136     public IJavaThread[] getWaitingThreads() throws DebugException;
137     
138     /**
139      * Returns the threads which owns for the monitor associated to this object, or
140      * <code>null</code> if no thread owns the monitor.
141      *
142      * @return the thread which owns the monitor, or <code>null</code>.
143      * @exception DebugException if this method fails. Reasons include:
144      * <ul><li>The VM is not able to retrieve the monitor information</li>
145      * <li>Failure communicating with the VM. The DebugException's
146      * status code contains the underlying exception responsible for
147      * the failure.</li></ul>
148      * @since 3.1
149      */

150     public IJavaThread getOwningThread() throws DebugException;
151     
152     /**
153      * Returns objects that directly reference this object.
154      *
155      * @param max the maximum number of references to retrieve or 0 for all references
156      * @return objects that directly reference this object
157      * @throws DebugException
158      * @since 3.3
159      */

160     public IJavaObject[] getReferringObjects(long max) throws DebugException;
161 }
162
163
164
Popular Tags