KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.runtime.CoreException;
15 import org.eclipse.debug.core.model.IBreakpoint;
16
17 /**
18  * A breakpoint specific to the Java debug model. A Java breakpoint
19  * supports:
20  * <ul>
21  * <li>a hit count</li>
22  * <li>a suspend policy that determines if the entire VM or
23  * a single thread is suspended when hit</li>
24  * <li>a thread filter to restrict a breakpoint to a specific
25  * thread within a VM</li>
26  * <li>an installed property that indicates a breakpoint was successfully
27  * installed in a VM</li>
28  * </ul>
29  * <p>
30  * Clients are not intended to implement this interface
31  * </p>
32  * @since 2.0
33  */

34 public interface IJavaBreakpoint extends IBreakpoint {
35     
36     /**
37      * Suspend policy constant indicating a breakpoint will
38      * suspend the target VM when hit.
39      */

40     public static final int SUSPEND_VM = 1;
41     
42     /**
43      * Default suspend policy constant indicating a breakpoint will
44      * suspend only the thread in which it occurred.
45      */

46     public static final int SUSPEND_THREAD = 2;
47     
48     /**
49      * Returns whether this breakpoint is installed in at least
50      * one debug target.
51      *
52      * @return whether this breakpoint is installed
53      * @exception CoreException if unable to access the property
54      * on this breakpoint's underlying marker
55      */

56     public boolean isInstalled() throws CoreException;
57     /**
58      * Returns the fully qualified name of the type this breakpoint
59      * is located in, or <code>null</code> if this breakpoint
60      * is not located in a specific type - for example, a pattern breakpoint.
61      *
62      * @return the fully qualified name of the type this breakpoint
63      * is located in, or <code>null</code>
64      * @exception CoreException if unable to access the property
65      * from this breakpoint's underlying marker
66      */

67     public String JavaDoc getTypeName() throws CoreException;
68     /**
69      * Returns this breakpoint's hit count or, -1 if this
70      * breakpoint does not have a hit count.
71      *
72      * @return this breakpoint's hit count, or -1
73      * @exception CoreException if unable to access the property
74      * from this breakpoint's underlying marker
75      */

76     public int getHitCount() throws CoreException;
77     /**
78      * Sets the hit count attribute of this breakpoint.
79      * If this breakpoint is currently disabled and the hit count
80      * is set greater than -1, this breakpoint is automatically enabled.
81      *
82      * @param count the new hit count
83      * @exception CoreException if unable to set the property
84      * on this breakpoint's underlying marker
85      */

86     public void setHitCount(int count) throws CoreException;
87     
88     /**
89      * Sets whether all threads in the target VM will be suspended
90      * when this breakpoint is hit. When <code>SUSPEND_VM</code> the target
91      * VM is suspended, and when <code>SUSPEND_THREAD</code> only the thread
92      * in which this breakpoint occurred is suspended.
93      *
94      * @param suspendPolicy one of <code>SUSPEND_VM</code> or
95      * <code>SUSPEND_THREAD</code>
96      * @exception CoreException if unable to set the property
97      * on this breakpoint's underlying marker
98      */

99     public void setSuspendPolicy(int suspendPolicy) throws CoreException;
100     
101     /**
102      * Returns the suspend policy used by this breakpoint, one of
103      * <code>SUSPEND_VM</code> or <code>SUSPEND_THREAD</code>.
104      *
105      * @return one of <code>SUSPEND_VM</code> or <code>SUSPEND_THREAD</code>
106      * @exception CoreException if unable to access the property
107      * from this breakpoint's underlying marker
108      */

109     public int getSuspendPolicy() throws CoreException;
110     
111     /**
112      * Restricts this breakpoint to suspend only in the given thread
113      * when encountered in the given thread's target. A breakpoint can
114      * only be restricted to one thread per target. Any previous
115      * thread filter for the same target is lost.
116      * A thread filter is not persisted
117      * across workbench invocations.
118      *
119      * @exception CoreException if unable to set the thread filter
120      */

121     public void setThreadFilter(IJavaThread thread) throws CoreException;
122     
123     /**
124      * Removes this breakpoint's thread filter in the given target, if any.
125      * Has no effect if this breakpoint does not have a filter in the given target.
126      *
127      * @param target the target whose thread filter will be removed
128      * @exception CoreException if unable to remove the thread filter
129      */

130     public void removeThreadFilter(IJavaDebugTarget target) throws CoreException;
131     
132     /**
133      * Returns the thread in the given target in which this breakpoint
134      * is enabled or <code>null</code> if this breakpoint is enabled in
135      * all threads in the given target.
136      *
137      * @return the thread in the given target that this breakpoint is enabled for
138      * @exception CoreException if unable to determine this breakpoint's thread
139      * filter
140      */

141     public IJavaThread getThreadFilter(IJavaDebugTarget target) throws CoreException;
142     /**
143      * Returns all thread filters set on this breakpoint.
144      *
145      * @return the threads that this breakpoint is restricted to
146      * @exception CoreException if unable to determine this breakpoint's
147      * thread filters
148      */

149     public IJavaThread[] getThreadFilters() throws CoreException;
150     
151     /**
152      * Adds the given object to the list of objects in which this
153      * breakpoint is restricted to suspend execution. Has no effect
154      * if the object has already been added. Note that clients should
155      * first ensure that a breakpoint supports instance filters.
156      * <p>
157      * Note: This implementation will add more than one filter. However, if there is
158      * more than one instance filter for a debug target, the breakpoint will never be hit
159      * in that target, as the current context cannot be two different instances at the
160      * same time.
161      * </p>
162      *
163      * @param object instance filter to add
164      * @exception CoreException if unable to add the given instance filter
165      * @since 2.1
166      */

167     public void addInstanceFilter(IJavaObject object) throws CoreException;
168     
169     /**
170      * Removes the given object from the list of objects in which this
171      * breakpoint is restricted to suspend execution. Has no effect if the
172      * object has not yet been added as an instance filter.
173      *
174      * @param object instance filter to remove
175      * @exception CoreException if unable to remove the given instance filter
176      * @since 2.1
177      */

178     public void removeInstanceFilter(IJavaObject object) throws CoreException;
179     
180     /**
181      * Returns whether this breakpoints supports instance filters.
182      *
183      * @return whether this breakpoints supports instance filters
184      * @since 3.0
185      */

186     public boolean supportsInstanceFilters();
187     
188     /**
189      * Returns the current set of active instance filters.
190      *
191      * @return the current set of active instance filters.
192      * @exception CoreException if unable to retrieve the list
193      * @since 2.1
194      */

195     public IJavaObject[] getInstanceFilters() throws CoreException;
196
197     /**
198      * Returns whether this breakpoints supports thread filters.
199      *
200      * @return whether this breakpoints supports thread filters
201      * @since 3.0
202      */

203     public boolean supportsThreadFilters();
204     
205 }
206
207
Popular Tags