APIdia Launch Partner
Top Description Methods
com.sun.jdi.request

public Interface EventRequestManager

extends Mirror
Known Direct Implementers
com.sun.tools.jdi.EventRequestManagerImpl
Imports
java.util.List, com.sun.jdi.Field, .Location, .Mirror, .NativeMethodException, .ReferenceType, .ThreadReference, .VirtualMachine, com.sun.jdi.event.BreakpointEvent, .Event, .EventSet, .ExceptionEvent, .VMDeathEvent

Manages the creation and deletion of EventRequests. A single implementor of this interface exists in a particular VM and is accessed through VirtualMachine#eventRequestManager()
Author
Robert Field
Since
1.3
See Also
EventRequest, Event, BreakpointRequest, BreakpointEvent, VirtualMachine

Method Summary

Modifier and TypeMethod and Description
public List<AccessWatchpointRequest>

Returns:

the all AccessWatchpointRequest objects.
accessWatchpointRequests
()

Return an unmodifiable list of the enabled and disabled access watchpoint requests.

public List<BreakpointRequest>

Returns:

the list of all BreakpointRequest objects.
breakpointRequests
()

Return an unmodifiable list of the enabled and disabled breakpoint requests.

public List<ClassPrepareRequest>

Returns:

the all ClassPrepareRequest objects.
classPrepareRequests
()

Return an unmodifiable list of the enabled and disabled class prepare requests.

public List<ClassUnloadRequest>

Returns:

the all ClassUnloadRequest objects.
classUnloadRequests
()

Return an unmodifiable list of the enabled and disabled class unload requests.

public AccessWatchpointRequest

Returns:

the created watchpoint
createAccessWatchpointRequest
(Field
the field to watch
field
)

Creates a new disabled watchpoint which watches accesses to the specified field.

public BreakpointRequest

Returns:

the created BreakpointRequest
createBreakpointRequest
(Location
the location of the new breakpoint.
location
)

Creates a new disabled BreakpointRequest.

public ClassPrepareRequest

Returns:

the created ClassPrepareRequest
createClassPrepareRequest
()

Creates a new disabled ClassPrepareRequest.

public ClassUnloadRequest

Returns:

the created ClassUnloadRequest
createClassUnloadRequest
()

Creates a new disabled ClassUnloadRequest.

public ExceptionRequest

Returns:

the created ExceptionRequest
createExceptionRequest
(ReferenceType
If non-null, specifies that exceptions which are instances of refType will be reported.

Note

this will include instances of sub-types. If null, all instances will be reported

refType
,
boolean
If true, caught exceptions will be reported.
notifyCaught
,
boolean
If true, uncaught exceptions will be reported.
notifyUncaught
)

Creates a new disabled ExceptionRequest.

public MethodEntryRequest

Returns:

the created MethodEntryRequest
createMethodEntryRequest
()

Creates a new disabled MethodEntryRequest.

public MethodExitRequest

Returns:

the created MethodExitRequest
createMethodExitRequest
()

Creates a new disabled MethodExitRequest.

public ModificationWatchpointRequest

Returns:

the created watchpoint
createModificationWatchpointRequest
(Field
the field to watch
field
)

Creates a new disabled watchpoint which watches accesses to the specified field.

public MonitorContendedEnteredRequest
public MonitorContendedEnterRequest
public MonitorWaitedRequest

Returns:

the created MonitorWaitedRequest
createMonitorWaitedRequest
()

Creates a new disabled MonitorWaitedRequest.

public MonitorWaitRequest

Returns:

the created MonitorWaitRequest
createMonitorWaitRequest
()

Creates a new disabled MonitorWaitRequest.

public StepRequest

Returns:

the created StepRequest
createStepRequest
(ThreadReference
the thread in which to step
thread
,
int
the step size
size
,
int
the step depth
depth
)

Creates a new disabled StepRequest.

public ThreadDeathRequest

Returns:

the created ThreadDeathRequest
createThreadDeathRequest
()

Creates a new disabled ThreadDeathRequest.

public ThreadStartRequest

Returns:

the created ThreadStartRequest
createThreadStartRequest
()

Creates a new disabled ThreadStartRequest.

public VMDeathRequest

Returns:

the created request
createVMDeathRequest
()

Creates a new disabled VMDeathRequest.

public void
deleteAllBreakpoints()

Remove all breakpoints managed by this EventRequestManager.

public void
deleteEventRequest(EventRequest
the eventRequest to remove
eventRequest
)

Removes an eventRequest.

public void
deleteEventRequests(List<? extends EventRequest>
the list of eventRequests to remove
eventRequests
)

Removes a list of EventRequests.

public List<ExceptionRequest>

Returns:

the all ExceptionRequest objects.
exceptionRequests
()

Return an unmodifiable list of the enabled and disabled exception requests.

public List<MethodEntryRequest>

Returns:

the list of all MethodEntryRequest objects.
methodEntryRequests
()

Return an unmodifiable list of the enabled and disabled method entry requests.

public List<MethodExitRequest>

Returns:

the list of all MethodExitRequest objects.
methodExitRequests
()

Return an unmodifiable list of the enabled and disabled method exit requests.

public List<ModificationWatchpointRequest>

Returns:

the all ModificationWatchpointRequest objects.
modificationWatchpointRequests
()

Return an unmodifiable list of the enabled and disabled modification watchpoint requests.

public List<MonitorContendedEnteredRequest>

Returns:

the list of all MonitorContendedEnteredRequest objects.
monitorContendedEnteredRequests
()

Return an unmodifiable list of the enabled and disabled monitor contended entered requests.

public List<MonitorContendedEnterRequest>

Returns:

the list of all MonitorContendedEnterRequest objects.
monitorContendedEnterRequests
()

Return an unmodifiable list of the enabled and disabled monitor contended enter requests.

public List<MonitorWaitedRequest>

Returns:

the list of all MonitorWaitedRequest objects.
monitorWaitedRequests
()

Return an unmodifiable list of the enabled and disabled monitor waited requests.

public List<MonitorWaitRequest>

Returns:

the list of all MonitorWaitRequest objects.
monitorWaitRequests
()

Return an unmodifiable list of the enabled and disabled monitor wait requests.

public List<StepRequest>

Returns:

the all StepRequest objects.
stepRequests
()

Return an unmodifiable list of the enabled and disabled step requests.

public List<ThreadDeathRequest>

Returns:

the all ThreadDeathRequest objects.
threadDeathRequests
()

Return an unmodifiable list of the enabled and disabled thread death requests.

public List<ThreadStartRequest>

Returns:

the all ThreadStartRequest objects.
threadStartRequests
()

Return an unmodifiable list of the enabled and disabled thread start requests.

public List<VMDeathRequest>

Returns:

the list of all VMDeathRequest objects.
vmDeathRequests
()

Return an unmodifiable list of the enabled and disabled VM death requests.

Inherited from com.sun.jdi.Mirror:
toStringvirtualMachine

Method Detail

accessWatchpointRequestsback to summary
public List<AccessWatchpointRequest> accessWatchpointRequests()

Return an unmodifiable list of the enabled and disabled access watchpoint requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<AccessWatchpointRequest>

the all AccessWatchpointRequest objects.

breakpointRequestsback to summary
public List<BreakpointRequest> breakpointRequests()

Return an unmodifiable list of the enabled and disabled breakpoint requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<BreakpointRequest>

the list of all BreakpointRequest objects.

classPrepareRequestsback to summary
public List<ClassPrepareRequest> classPrepareRequests()

Return an unmodifiable list of the enabled and disabled class prepare requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ClassPrepareRequest>

the all ClassPrepareRequest objects.

classUnloadRequestsback to summary
public List<ClassUnloadRequest> classUnloadRequests()

Return an unmodifiable list of the enabled and disabled class unload requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ClassUnloadRequest>

the all ClassUnloadRequest objects.

createAccessWatchpointRequestback to summary
public AccessWatchpointRequest createAccessWatchpointRequest(Field field)

Creates a new disabled watchpoint which watches accesses to the specified field. The new watchpoint is added to the list managed by this EventRequestManager. Multiple watchpoints on the same field are permitted. Use EventRequest#enable() to activate this event request.

Not all target virtual machines support this operation. Use VirtualMachine#canWatchFieldAccess() to determine if the operation is supported.

Parameters
field:Field

the field to watch

Returns:AccessWatchpointRequest

the created watchpoint

Exceptions
UnsupportedOperationException:
if the target virtual machine does not support this operation.
createBreakpointRequestback to summary
public BreakpointRequest createBreakpointRequest(Location location)

Creates a new disabled BreakpointRequest. The given Location must have a valid (that is, non-negative) code index. The new breakpoint is added to the list managed by this EventRequestManager. Multiple breakpoints at the same location are permitted. Use EventRequest#enable() to activate this event request.

Parameters
location:Location

the location of the new breakpoint.

Returns:BreakpointRequest

the created BreakpointRequest

Exceptions
NativeMethodException:
if location is within a native method.
createClassPrepareRequestback to summary
public ClassPrepareRequest createClassPrepareRequest()

Creates a new disabled ClassPrepareRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:ClassPrepareRequest

the created ClassPrepareRequest

createClassUnloadRequestback to summary
public ClassUnloadRequest createClassUnloadRequest()

Creates a new disabled ClassUnloadRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:ClassUnloadRequest

the created ClassUnloadRequest

createExceptionRequestback to summary
public ExceptionRequest createExceptionRequest(ReferenceType refType, boolean notifyCaught, boolean notifyUncaught)

Creates a new disabled ExceptionRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

A specific exception type and its subclasses can be selected for exception events. Caught exceptions, uncaught exceptions, or both can be selected. Note, however, that at the time an exception is thrown, it is not always possible to determine whether it is truly caught. See ExceptionEvent#catchLocation for details.

Parameters
refType:ReferenceType

If non-null, specifies that exceptions which are instances of refType will be reported.

Note

this will include instances of sub-types. If null, all instances will be reported

notifyCaught:boolean

If true, caught exceptions will be reported.

notifyUncaught:boolean

If true, uncaught exceptions will be reported.

Returns:ExceptionRequest

the created ExceptionRequest

createMethodEntryRequestback to summary
public MethodEntryRequest createMethodEntryRequest()

Creates a new disabled MethodEntryRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:MethodEntryRequest

the created MethodEntryRequest

createMethodExitRequestback to summary
public MethodExitRequest createMethodExitRequest()

Creates a new disabled MethodExitRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:MethodExitRequest

the created MethodExitRequest

createModificationWatchpointRequestback to summary
public ModificationWatchpointRequest createModificationWatchpointRequest(Field field)

Creates a new disabled watchpoint which watches accesses to the specified field. The new watchpoint is added to the list managed by this EventRequestManager. Multiple watchpoints on the same field are permitted. Use EventRequest#enable() to activate this event request.

Not all target virtual machines support this operation. Use VirtualMachine#canWatchFieldModification() to determine if the operation is supported.

Parameters
field:Field

the field to watch

Returns:ModificationWatchpointRequest

the created watchpoint

Exceptions
UnsupportedOperationException:
if the target virtual machine does not support this operation.
createMonitorContendedEnteredRequestback to summary
public MonitorContendedEnteredRequest createMonitorContendedEnteredRequest()

Creates a new disabled MonitorContendedEnteredRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request. Not all target virtual machines support this operation. Use VirtualMachine#canRequestMonitorEvents() to determine if the operation is supported.

Returns:MonitorContendedEnteredRequest

the created MonitorContendedEnteredRequest

Exceptions
UnsupportedOperationException:
if the target VM does not support this operation.
Since
1.6
createMonitorContendedEnterRequestback to summary
public MonitorContendedEnterRequest createMonitorContendedEnterRequest()

Creates a new disabled MonitorContendedEnterRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request. Not all target virtual machines support this operation. Use VirtualMachine#canRequestMonitorEvents() to determine if the operation is supported.

Returns:MonitorContendedEnterRequest

the created MonitorContendedEnterRequest

Exceptions
UnsupportedOperationException:
if the target VM does not support this operation.
Since
1.6
createMonitorWaitedRequestback to summary
public MonitorWaitedRequest createMonitorWaitedRequest()

Creates a new disabled MonitorWaitedRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request. Not all target virtual machines support this operation. Use VirtualMachine#canRequestMonitorEvents() to determine if the operation is supported.

Returns:MonitorWaitedRequest

the created MonitorWaitedRequest

Exceptions
UnsupportedOperationException:
if the target VM does not support this operation.
Since
1.6
createMonitorWaitRequestback to summary
public MonitorWaitRequest createMonitorWaitRequest()

Creates a new disabled MonitorWaitRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request. Not all target virtual machines support this operation. Use VirtualMachine#canRequestMonitorEvents() to determine if the operation is supported.

Returns:MonitorWaitRequest

the created MonitorWaitRequest

Exceptions
UnsupportedOperationException:
if the target VM does not support this operation.
Since
1.6
createStepRequestback to summary
public StepRequest createStepRequest(ThreadReference thread, int size, int depth)

Creates a new disabled StepRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

The returned request will control stepping only in the specified thread; all other threads will be unaffected. A size value of StepRequest#STEP_MIN will generate a step event each time the code index changes. It represents the smallest step size available and often maps to the instruction level. A size value of StepRequest#STEP_LINE will generate a step event each time the source line changes unless line number information is not available, in which case a STEP_MIN will be done instead. For example, no line number information is available during the execution of a method that has been rendered obsolete by by a VirtualMachine#redefineClasses operation. A depth value of StepRequest#STEP_INTO will generate step events in any called methods. A depth value of StepRequest#STEP_OVER restricts step events to the current frame or caller frames. A depth value of StepRequest#STEP_OUT restricts step events to caller frames only. All depth restrictions are relative to the call stack immediately before the step takes place.

Only one pending step request is allowed per thread.

Note that a typical debugger will want to cancel stepping after the first step is detected. Thus a next line method would do the following:

EventRequestManager mgr = myVM.eventRequestManager();
    StepRequest request = mgr.createStepRequest(myThread,
                                                StepRequest.STEP_LINE,
                                                StepRequest.STEP_OVER);
    request.addCountFilter(1);  // next step only
    request.enable();
    myVM.resume();
Parameters
thread:ThreadReference

the thread in which to step

size:int

the step size

depth:int

the step depth

Returns:StepRequest

the created StepRequest

Exceptions
DuplicateRequestException:
if there is already a pending step request for the specified thread.
IllegalArgumentException:
if the size or depth arguments contain illegal values.
createThreadDeathRequestback to summary
public ThreadDeathRequest createThreadDeathRequest()

Creates a new disabled ThreadDeathRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:ThreadDeathRequest

the created ThreadDeathRequest

createThreadStartRequestback to summary
public ThreadStartRequest createThreadStartRequest()

Creates a new disabled ThreadStartRequest. The new event request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

Returns:ThreadStartRequest

the created ThreadStartRequest

createVMDeathRequestback to summary
public VMDeathRequest createVMDeathRequest()

Creates a new disabled VMDeathRequest. The new request is added to the list managed by this EventRequestManager. Use EventRequest#enable() to activate this event request.

This request (if enabled) will cause a VMDeathEvent to be sent on termination of the target VM.

A VMDeathRequest with a suspend policy of SUSPEND_ALL can be used to assure processing of incoming SUSPEND_NONE or SUSPEND_EVENT_THREAD events before VM death. If all event processing is being done in the same thread as event sets are being read, enabling the request is all that is needed since the VM will be suspended until the EventSet containing the VMDeathEvent is resumed.

Not all target virtual machines support this operation. Use VirtualMachine#canRequestVMDeathEvent() to determine if the operation is supported.

Returns:VMDeathRequest

the created request

Exceptions
UnsupportedOperationException:
if the target VM does not support this operation.
Since
1.4
deleteAllBreakpointsback to summary
public void deleteAllBreakpoints()

Remove all breakpoints managed by this EventRequestManager.

See Also
deleteEventRequest(EventRequest)
deleteEventRequestback to summary
public void deleteEventRequest(EventRequest eventRequest)

Removes an eventRequest. The eventRequest is disabled and the removed from the requests managed by this EventRequestManager. Once the eventRequest is deleted, no operations (for example, EventRequest#setEnabled) are permitted - attempts to do so will generally cause an InvalidRequestStateException. No other eventRequests are effected.

Because this method changes the underlying lists of event requests, attempting to directly delete from a list returned by a request accessor (e.g. below):

  Iterator iter = requestManager.stepRequests().iterator();
  while (iter.hasNext()) {
     requestManager.deleteEventRequest(iter.next());
  }
may cause a java.util.ConcurrentModificationException. Instead use deleteEventRequests(List) or copy the list before iterating.
Parameters
eventRequest:EventRequest

the eventRequest to remove

deleteEventRequestsback to summary
public void deleteEventRequests(List<? extends EventRequest> eventRequests)

Removes a list of EventRequests.

Parameters
eventRequests:List<? extends EventRequest>

the list of eventRequests to remove

See Also
deleteEventRequest(EventRequest)
exceptionRequestsback to summary
public List<ExceptionRequest> exceptionRequests()

Return an unmodifiable list of the enabled and disabled exception requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ExceptionRequest>

the all ExceptionRequest objects.

methodEntryRequestsback to summary
public List<MethodEntryRequest> methodEntryRequests()

Return an unmodifiable list of the enabled and disabled method entry requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MethodEntryRequest>

the list of all MethodEntryRequest objects.

methodExitRequestsback to summary
public List<MethodExitRequest> methodExitRequests()

Return an unmodifiable list of the enabled and disabled method exit requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MethodExitRequest>

the list of all MethodExitRequest objects.

modificationWatchpointRequestsback to summary
public List<ModificationWatchpointRequest> modificationWatchpointRequests()

Return an unmodifiable list of the enabled and disabled modification watchpoint requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ModificationWatchpointRequest>

the all ModificationWatchpointRequest objects.

monitorContendedEnteredRequestsback to summary
public List<MonitorContendedEnteredRequest> monitorContendedEnteredRequests()

Return an unmodifiable list of the enabled and disabled monitor contended entered requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MonitorContendedEnteredRequest>

the list of all MonitorContendedEnteredRequest objects.

Since
1.6
monitorContendedEnterRequestsback to summary
public List<MonitorContendedEnterRequest> monitorContendedEnterRequests()

Return an unmodifiable list of the enabled and disabled monitor contended enter requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MonitorContendedEnterRequest>

the list of all MonitorContendedEnterRequest objects.

Since
1.6
monitorWaitedRequestsback to summary
public List<MonitorWaitedRequest> monitorWaitedRequests()

Return an unmodifiable list of the enabled and disabled monitor waited requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MonitorWaitedRequest>

the list of all MonitorWaitedRequest objects.

Since
1.6
monitorWaitRequestsback to summary
public List<MonitorWaitRequest> monitorWaitRequests()

Return an unmodifiable list of the enabled and disabled monitor wait requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<MonitorWaitRequest>

the list of all MonitorWaitRequest objects.

Since
1.6
stepRequestsback to summary
public List<StepRequest> stepRequests()

Return an unmodifiable list of the enabled and disabled step requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<StepRequest>

the all StepRequest objects.

threadDeathRequestsback to summary
public List<ThreadDeathRequest> threadDeathRequests()

Return an unmodifiable list of the enabled and disabled thread death requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ThreadDeathRequest>

the all ThreadDeathRequest objects.

threadStartRequestsback to summary
public List<ThreadStartRequest> threadStartRequests()

Return an unmodifiable list of the enabled and disabled thread start requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Returns:List<ThreadStartRequest>

the all ThreadStartRequest objects.

vmDeathRequestsback to summary
public List<VMDeathRequest> vmDeathRequests()

Return an unmodifiable list of the enabled and disabled VM death requests. This list is a live view of these requests and thus changes as requests are added and deleted.

Note

the unsolicited VMDeathEvent does not have a corresponding request.

Returns:List<VMDeathRequest>

the list of all VMDeathRequest objects.

Since
1.4