1 /* |
1 /* |
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.jdi.event; |
26 package com.sun.jdi.event; |
27 |
27 |
28 import com.sun.jdi.*; |
28 import java.util.Set; |
29 |
29 |
30 import java.util.Set; |
30 import com.sun.jdi.Location; |
|
31 import com.sun.jdi.Mirror; |
|
32 import com.sun.jdi.ThreadReference; |
|
33 import com.sun.jdi.VirtualMachine; |
|
34 import com.sun.jdi.request.BreakpointRequest; |
|
35 import com.sun.jdi.request.EventRequest; |
31 |
36 |
32 /** |
37 /** |
33 * Several {@link Event} objects may be created at a given time by |
38 * Several {@link Event} objects may be created at a given time by |
34 * the target {@link VirtualMachine}. For example, there may be |
39 * the target {@link VirtualMachine}. For example, there may be |
35 * more than one {@link com.sun.jdi.request.BreakpointRequest} |
40 * more than one {@link BreakpointRequest} for a given {@link Location} |
36 * for a given {@link Location} |
|
37 * or you might single step to the same location as a |
41 * or you might single step to the same location as a |
38 * BreakpointRequest. These {@link Event} objects are delivered |
42 * BreakpointRequest. These {@link Event} objects are delivered |
39 * together as an EventSet. For uniformity, an EventSet is always used |
43 * together as an EventSet. For uniformity, an EventSet is always used |
40 * to deliver {@link Event} objects. EventSets are delivered by |
44 * to deliver {@link Event} objects. EventSets are delivered by |
41 * the {@link EventQueue}. |
45 * the {@link EventQueue}. |
123 * @see EventQueue |
127 * @see EventQueue |
124 * |
128 * |
125 * @author Robert Field |
129 * @author Robert Field |
126 * @since 1.3 |
130 * @since 1.3 |
127 */ |
131 */ |
128 |
|
129 public interface EventSet extends Mirror, Set<Event> { |
132 public interface EventSet extends Mirror, Set<Event> { |
130 |
133 |
131 /** |
134 /** |
132 * Returns the policy used to suspend threads in the target VM |
135 * Returns the policy used to suspend threads in the target VM |
133 * for this event set. This policy is selected from the suspend |
136 * for this event set. This policy is selected from the suspend |
134 * policies for each event's request; the target VM chooses the |
137 * policies for each event's request; the target VM chooses the |
135 * policy which suspends the most threads. The target VM |
138 * policy which suspends the most threads. The target VM suspends |
136 * suspends threads according to that policy |
139 * threads according to that policy and that policy is returned here. |
137 * and that policy is returned here. See |
140 * See {@link EventRequest} for the possible policy values. |
138 * {@link com.sun.jdi.request.EventRequest} for the possible |
|
139 * policy values. |
|
140 * <p> |
141 * <p> |
141 * In rare cases, the suspend policy may differ from the requested |
142 * In rare cases, the suspend policy may differ from the requested |
142 * value if a {@link ClassPrepareEvent} has occurred in a |
143 * value if a {@link ClassPrepareEvent} has occurred in a |
143 * debugger system thread. See {@link ClassPrepareEvent#thread} |
144 * debugger system thread. See {@link ClassPrepareEvent#thread} |
144 * for details. |
145 * for details. |
145 * |
146 * |
146 * @return the suspendPolicy which is either |
147 * @return the suspendPolicy which is either |
147 * {@link com.sun.jdi.request.EventRequest#SUSPEND_ALL SUSPEND_ALL}, |
148 * {@link EventRequest#SUSPEND_ALL SUSPEND_ALL}, |
148 * {@link com.sun.jdi.request.EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD} or |
149 * {@link EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD} or |
149 * {@link com.sun.jdi.request.EventRequest#SUSPEND_NONE SUSPEND_NONE}. |
150 * {@link EventRequest#SUSPEND_NONE SUSPEND_NONE}. |
150 */ |
151 */ |
151 int suspendPolicy(); |
152 int suspendPolicy(); |
152 |
153 |
153 /** |
154 /** |
154 * Return an iterator specific to {@link Event} objects. |
155 * Return an iterator specific to {@link Event} objects. |
155 */ |
156 */ |
156 EventIterator eventIterator(); |
157 EventIterator eventIterator(); |
157 |
158 |
158 /** |
159 /** |
159 * Resumes threads suspended by this event set. If the {@link #suspendPolicy} |
160 * Resumes threads suspended by this event set. If the {@link #suspendPolicy} |
160 * is {@link com.sun.jdi.request.EventRequest#SUSPEND_ALL}, a call |
161 * is {@link EventRequest#SUSPEND_ALL}, a call to this method is equivalent to |
161 * to this method is equivalent to |
162 * {@link VirtualMachine#resume}. If the suspend policy is |
162 * {@link com.sun.jdi.VirtualMachine#resume}. If the |
163 * {@link EventRequest#SUSPEND_EVENT_THREAD}, |
163 * suspend policy is |
|
164 * {@link com.sun.jdi.request.EventRequest#SUSPEND_EVENT_THREAD}, |
|
165 * a call to this method is equivalent to |
164 * a call to this method is equivalent to |
166 * {@link com.sun.jdi.ThreadReference#resume} for the event thread. |
165 * {@link ThreadReference#resume} for the event thread. |
167 * Otherwise, a call to this method is a no-op. |
166 * Otherwise, a call to this method is a no-op. |
168 */ |
167 */ |
169 void resume(); |
168 void resume(); |
170 } |
169 } |