KickJava   Java API By Example, From Geeks To Geeks.

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


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.core;
12
13 import org.eclipse.debug.core.DebugException;
14 import org.eclipse.jdt.core.dom.Message;
15
16
17 /**
18  * Provides event and error notification for Java breakpoints.
19  * Listeners register with the <code>JDIDebugModel</code>.
20  * <p>
21  * Clients are intended to implement this interface.
22  * </p>
23  * @since 2.0
24  */

25 public interface IJavaBreakpointListener {
26     
27     /**
28      * Return code in response to a "breakpoint hit" notification, indicating
29      * a vote to suspend the associated thread.
30      *
31      * @since 3.0
32      */

33     public static int SUSPEND= 0x0001;
34     /**
35      * Return code in response to a "breakpoint hit" notification, indicating
36      * a vote to not suspend (i.e. resume) the associated thread.
37      *
38      * @since 3.0
39      */

40     public static int DONT_SUSPEND= 0x0002;
41     /**
42      * Return code in response to an "installing" notification, indicating
43      * a vote to install the associated breakpoint.
44      *
45      * @since 3.0
46      */

47     public static int INSTALL= 0x0001;
48     /**
49      * Return code in response to an "installing" notification, indicating
50      * a vote to not install the associated breakpoint.
51      *
52      * @since 3.0
53      */

54     public static int DONT_INSTALL= 0x0002;
55     /**
56      * Return code indicating that this listener should not be considered
57      * in a vote to suspend a thread or install a breakpoint.
58      *
59      * @since 3.0
60      */

61     public static int DONT_CARE= 0x0004;
62     
63     /**
64      * Notification that the given breakpoint is about to be added to
65      * the specified target. This message is sent before the breakpoint
66      * is actually added to the debut target (i.e. this is a
67      * pre-notification).
68      *
69      * @param target Java debug target
70      * @param breakpoint Java breakpoint
71      */

72     public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
73     
74     /**
75      * Notification that the given breakpoint is about to be installed in
76      * the specified target, in the specified type. Allows this listener to
77      * vote to determine if the given breakpoint should be installed in
78      * the specified type and target. If at least one listener votes to
79      * <code>INSTALL</code>, the breakpoint will be installed. If there
80      * are no votes to install the breakpoint, there must be at least one
81      * <code>DONT_INSTALL</code> vote to cancel the installation. If all
82      * listeners vote <code>DONT_CARE</code>, the breakpoint will be installed
83      * by default.
84      *
85      * @param target Java debug target
86      * @param breakpoint Java breakpoint
87      * @param type the type (class or interface) the breakpoint is about to be installed in
88      * or <code>null</code> if the given breakpoint is not installed in a specific type
89      * (one of <code>IJavaClassType</code>, <code>IJavaInterfaceType</code>, or
90      * <code>IJavaArrayType</code>)
91      * @return whether the the breakpoint should be installed in the given type and target,
92      * or whether this listener doesn't care - one of <code>INSTALL</code>,
93      * <code>DONT_INSTALL</code>, or <code>DONT_CARE</code>
94      * @since 3.0
95      */

96     public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type);
97         
98     /**
99      * Notification that the given breakpoint has been installed in
100      * the specified target.
101      *
102      * @param target Java debug target
103      * @param breakpoint Java breakpoint
104      */

105     public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
106     
107     /**
108      * Notification that the given breakpoint has been hit
109      * in the specified thread. Allows this listener to
110      * vote to determine if the given thread should be suspended in
111      * reponse to the breakpoint. If at least one listener votes to
112      * <code>SUSPEND</code>, the thread will suspend. If there
113      * are no votes to suspend the thread, there must be at least one
114      * <code>DONT_SUSPEND</code> vote to avoid the suspension (resume). If all
115      * listeners vote <code>DONT_CARE</code>, the thread will suspend by default.
116      *
117      * @param thread Java thread
118      * @param breakpoint Java breakpoint
119      * @return whether the thread should suspend or whether this
120      * listener doesn't care - one of <code>SUSPEND</code>,
121      * <code>DONT_SUSPEND</code>, or <code>DONT_CARE</code>
122      * @since 3.0
123      */

124     public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint);
125     
126     /**
127      * Notification that the given breakpoint has been removed
128      * from the specified target.
129      *
130      * @param target Java debug target
131      * @param breakpoint Java breakpoint
132      */

133     public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint);
134     
135     /**
136      * Notification that the given breakpoint had runtime errors in its conditional
137      * expression.
138      *
139      * @param breakpoint the breakpoint
140      * @param exception the debug exception that occurred evaluating the breakpoint's
141      * condition
142      */

143     public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception);
144     
145     /**
146      * Notification that the given breakpoint has compilation errors in its conditional
147      * expression.
148      *
149      * @param breakpoint the breakpoint
150      * @param errors the compilation errors in the breakpoint's condition
151      */

152     public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors);
153 }
154
Popular Tags