2
|
1 |
/*
|
45564
|
2 |
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
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
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
2
|
24 |
*/
|
|
25 |
|
|
26 |
package com.sun.jdi.event;
|
|
27 |
|
45564
|
28 |
import java.util.Set;
|
2
|
29 |
|
45564
|
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;
|
2
|
36 |
|
|
37 |
/**
|
|
38 |
* Several {@link Event} objects may be created at a given time by
|
|
39 |
* the target {@link VirtualMachine}. For example, there may be
|
45564
|
40 |
* more than one {@link BreakpointRequest} for a given {@link Location}
|
2
|
41 |
* or you might single step to the same location as a
|
|
42 |
* BreakpointRequest. These {@link Event} objects are delivered
|
|
43 |
* together as an EventSet. For uniformity, an EventSet is always used
|
|
44 |
* to deliver {@link Event} objects. EventSets are delivered by
|
|
45 |
* the {@link EventQueue}.
|
|
46 |
* EventSets are unmodifiable.
|
|
47 |
* <P>
|
|
48 |
* Associated with the issuance of an event set, suspensions may
|
|
49 |
* have occurred in the target VM. These suspensions correspond
|
|
50 |
* with the {@link #suspendPolicy() suspend policy}.
|
|
51 |
* To assure matching resumes occur, it is recommended,
|
|
52 |
* where possible,
|
|
53 |
* to complete the processing of an event set with
|
|
54 |
* {@link #resume() EventSet.resume()}.
|
|
55 |
* <P>
|
|
56 |
* The events that are grouped in an EventSet are restricted in the
|
|
57 |
* following ways:
|
|
58 |
* <UL>
|
|
59 |
* <LI>Always singleton sets:
|
|
60 |
* <UL>
|
|
61 |
* <LI>{@link VMStartEvent}
|
|
62 |
* <LI>{@link VMDisconnectEvent}
|
|
63 |
* </UL>
|
|
64 |
* <LI>Only with other VMDeathEvents:
|
|
65 |
* <UL>
|
|
66 |
* <LI>{@link VMDeathEvent}
|
|
67 |
* </UL>
|
|
68 |
* <LI>Only with other ThreadStartEvents for the same thread:
|
|
69 |
* <UL>
|
|
70 |
* <LI>{@link ThreadStartEvent}
|
|
71 |
* </UL>
|
|
72 |
* <LI>Only with other ThreadDeathEvents for the same thread:
|
|
73 |
* <UL>
|
|
74 |
* <LI>{@link ThreadDeathEvent}
|
|
75 |
* </UL>
|
|
76 |
* <LI>Only with other ClassPrepareEvents for the same class:
|
|
77 |
* <UL>
|
|
78 |
* <LI>{@link ClassPrepareEvent}
|
|
79 |
* </UL>
|
|
80 |
* <LI>Only with other ClassUnloadEvents for the same class:
|
|
81 |
* <UL>
|
|
82 |
* <LI>{@link ClassUnloadEvent}
|
|
83 |
* </UL>
|
|
84 |
* <LI>Only with other AccessWatchpointEvents for the same field access:
|
|
85 |
* <UL>
|
|
86 |
* <LI>{@link AccessWatchpointEvent}
|
|
87 |
* </UL>
|
|
88 |
* <LI>Only with other ModificationWatchpointEvents for the same field
|
|
89 |
* modification:
|
|
90 |
* <UL>
|
|
91 |
* <LI>{@link ModificationWatchpointEvent}
|
|
92 |
* </UL>
|
|
93 |
* <LI>Only with other ExceptionEvents for the same exception occurrance:
|
|
94 |
* <UL>
|
|
95 |
* <LI>{@link ExceptionEvent}
|
|
96 |
* </UL>
|
|
97 |
* <LI>Only with other MethodExitEvents for the same method exit:
|
|
98 |
* <UL>
|
|
99 |
* <LI>{@link MethodExitEvent}
|
|
100 |
* </UL>
|
|
101 |
* <LI>Only with other Monitor contended enter events for the same monitor object:
|
|
102 |
* <UL>
|
|
103 |
* <LI>Monitor Contended Enter Event
|
|
104 |
* </UL>
|
|
105 |
* <LI>Only with other Monitor contended entered events for the same monitor object:
|
|
106 |
* <UL>
|
|
107 |
* <LI>Monitor Contended Entered Event
|
|
108 |
* </UL>
|
|
109 |
* <LI>Only with other Monitor wait events for the same monitor object:
|
|
110 |
* <UL>
|
|
111 |
* <LI>Monitor Wait Event
|
|
112 |
* </UL>
|
|
113 |
* <LI>Only with other Monitor waited events for the same monitor object:
|
|
114 |
* <UL>
|
|
115 |
* <LI>Monitor Waited Event
|
|
116 |
* </UL>
|
|
117 |
* <LI>Only with other members of this group, at the same location
|
|
118 |
* and in the same thread:
|
|
119 |
* <UL>
|
|
120 |
* <LI>{@link BreakpointEvent}
|
|
121 |
* <LI>{@link StepEvent}
|
|
122 |
* <LI>{@link MethodEntryEvent}
|
|
123 |
* </UL>
|
|
124 |
* </UL>
|
|
125 |
*
|
|
126 |
* @see Event
|
|
127 |
* @see EventQueue
|
|
128 |
*
|
|
129 |
* @author Robert Field
|
|
130 |
* @since 1.3
|
|
131 |
*/
|
|
132 |
public interface EventSet extends Mirror, Set<Event> {
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Returns the policy used to suspend threads in the target VM
|
|
136 |
* for this event set. This policy is selected from the suspend
|
|
137 |
* policies for each event's request; the target VM chooses the
|
45564
|
138 |
* policy which suspends the most threads. The target VM suspends
|
|
139 |
* threads according to that policy and that policy is returned here.
|
|
140 |
* See {@link EventRequest} for the possible policy values.
|
2
|
141 |
* <p>
|
|
142 |
* In rare cases, the suspend policy may differ from the requested
|
|
143 |
* value if a {@link ClassPrepareEvent} has occurred in a
|
|
144 |
* debugger system thread. See {@link ClassPrepareEvent#thread}
|
|
145 |
* for details.
|
|
146 |
*
|
|
147 |
* @return the suspendPolicy which is either
|
45564
|
148 |
* {@link EventRequest#SUSPEND_ALL SUSPEND_ALL},
|
|
149 |
* {@link EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD} or
|
|
150 |
* {@link EventRequest#SUSPEND_NONE SUSPEND_NONE}.
|
2
|
151 |
*/
|
|
152 |
int suspendPolicy();
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Return an iterator specific to {@link Event} objects.
|
|
156 |
*/
|
|
157 |
EventIterator eventIterator();
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Resumes threads suspended by this event set. If the {@link #suspendPolicy}
|
45564
|
161 |
* is {@link EventRequest#SUSPEND_ALL}, a call to this method is equivalent to
|
|
162 |
* {@link VirtualMachine#resume}. If the suspend policy is
|
|
163 |
* {@link EventRequest#SUSPEND_EVENT_THREAD},
|
2
|
164 |
* a call to this method is equivalent to
|
45564
|
165 |
* {@link ThreadReference#resume} for the event thread.
|
2
|
166 |
* Otherwise, a call to this method is a no-op.
|
|
167 |
*/
|
|
168 |
void resume();
|
|
169 |
}
|