BreakpointRequest and ExceptionRequest.
When an event occurs for which an enabled request is present,
an EventSet will
be placed on the EventQueue.
The collection of existing event requests is
managed by the EventRequestManager.
The number of events generated for an event request can be controlled
through filters. Filters provide additional constraints that an event
must satisfy before it is placed on the event queue. Multiple filters can
be used by making multiple calls to filter addition methods such as
ExceptionRequest#addClassFilter(java..
Filters are added to an event one at a time only while the event is
disabled. Multiple filters are applied with CUT-OFF AND, in the order
it was added to the request. Only events that satisfy all filters are
placed in the event queue.
The set of available filters is dependent on the event request, some examples of filters are:
Any method on EventRequest which
takes EventRequest as an parameter may throw
VMDisconnectedException if the target VM is
disconnected and the VMDisconnectEvent has been or is
available to be read from the EventQueue.
Any method on EventRequest which
takes EventRequest as an parameter may throw
VMOutOfMemoryException if the target VM has run out of memory.
BreakpointEvent, EventQueue, EventRequestManager
| Modifier and Type | Field and Description |
|---|---|
| public static final int | SUSPEND_ALL
Suspend all threads when the event occurs |
| public static final int | SUSPEND_EVENT_THREAD
Suspend only the thread which generated the event when the event occurs |
| public static final int | SUSPEND_NONE
Suspend no threads when the event occurs |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCountFilter(int
the number of occurrences before generating an event. count)Limit the requested event to be reported at most once after a given number of occurrences. |
| public void | |
| public void | |
| public Object | Returns: the value of this property or nullReturns the value of the property with the specified key. |
| public boolean | Returns: true if enabled;
false otherwise.Determines if this event request is currently enabled. |
| public void | |
| public void | setEnabled(boolean
true if the event request is to be enabled;
false otherwise.Enables or disables this event request. |
| public void | setSuspendPolicy(int
the selected suspend policy. policy)Determines the threads to suspend when the requested event occurs in the target VM. |
| public int | Returns: the current suspend mode for this requestReturns a value which describes the threads to suspend when the requested event occurs in the target VM. |
| SUSPEND_ALL | back to summary |
|---|---|
| public static final int SUSPEND_ALL Suspend all threads when the event occurs | |
| SUSPEND_EVENT_THREAD | back to summary |
|---|---|
| public static final int SUSPEND_EVENT_THREAD Suspend only the thread which generated the event when the event occurs | |
| SUSPEND_NONE | back to summary |
|---|---|
| public static final int SUSPEND_NONE Suspend no threads when the event occurs | |
| addCountFilter | back to summary |
|---|---|
| public void addCountFilter(int count) Limit the requested event to be reported at most once after a
given number of occurrences. The event is not reported
the first Once the count reaches 0, any subsequent filters in this request are applied. If none of those filters cause the event to be suppressed, the event is reported. Otherwise, the event is not reported. In either case subsequent events are never reported for this request.
| |
| disable | back to summary |
|---|---|
| public void disable() Same as
| |
| enable | back to summary |
|---|---|
| public void enable() Same as
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(Object key) Returns the value of the property with the specified key. Only
properties added with
| |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled() Determines if this event request is currently enabled.
| |
| putProperty | back to summary |
|---|---|
| public void putProperty(Object key, Object value) Add an arbitrary key/value "property" to this request. The property can be used by a client of the JDI to associate application information with the request; These client-set properties are not used internally by the JDI.
The If value is null this method will remove the property.
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean val) Enables or disables this event request. While this event request is
disabled, the event request will be ignored and the target VM
will not be stopped if any of its threads reaches the
event request. Disabled event requests still exist,
and are included in event request lists such as
| |
| setSuspendPolicy | back to summary |
|---|---|
| public void setSuspendPolicy(int policy) Determines the threads to suspend when the requested event occurs
in the target VM. Use
Thread suspensions through events have the same functionality
as explicitly requested suspensions. See
| |
| suspendPolicy | back to summary |
|---|---|
| public int suspendPolicy() Returns a value which describes the threads to suspend when the
requested event occurs in the target VM.
The returned value is
| |