Java Debug Interface

com.sun.jdi.request
Interface EventRequestManager

All Superinterfaces:
Mirror

public interface EventRequestManager
extends Mirror

Manages the creation and deletion of EventRequests. A single implementor of this interface exists in a particuar VM and is accessed through VirtualMachine.eventRequestManager()

Since:
1.3
See Also:
EventRequest, Event, BreakpointRequest, BreakpointEvent, VirtualMachine

Method Summary
 List accessWatchpointRequests()
           
 List breakpointRequests()
           
 List classPrepareRequests()
           
 List classUnloadRequests()
           
 AccessWatchpointRequest createAccessWatchpointRequest(Field field)
          Creates a new disabled watchpoint which watches accesses to the specified field.
 BreakpointRequest createBreakpointRequest(Location location)
          Creates a new disabled BreakpointRequest.
 ClassPrepareRequest createClassPrepareRequest()
          Creates a new disabled ClassPrepareRequest.
 ClassUnloadRequest createClassUnloadRequest()
          Creates a new disabled ClassUnloadRequest.
 ExceptionRequest createExceptionRequest(ReferenceType refType, boolean notifyCaught, boolean notifyUncaught)
          Creates a new disabled ExceptionRequest.
 MethodEntryRequest createMethodEntryRequest()
          Creates a new disabled MethodEntryRequest.
 MethodExitRequest createMethodExitRequest()
          Creates a new disabled MethodExitRequest.
 ModificationWatchpointRequest createModificationWatchpointRequest(Field field)
          Creates a new disabled watchpoint which watches accesses to the specified field.
 StepRequest createStepRequest(ThreadReference thread, int size, int depth)
          Creates a new disabled StepRequest.
 ThreadDeathRequest createThreadDeathRequest()
          Creates a new disabled ThreadDeathRequest.
 ThreadStartRequest createThreadStartRequest()
          Creates a new disabled ThreadStartRequest.
 void deleteAllBreakpoints()
          Remove all breakpoints managed by this EventRequestManager.
 void deleteEventRequest(EventRequest eventRequest)
          Removes a eventRequest.
 void deleteEventRequests(List eventRequests)
          Removes a list of EventRequests.
 List exceptionRequests()
           
 List methodEntryRequests()
           
 List methodExitRequests()
           
 List modificationWatchpointRequests()
           
 List stepRequests()
           
 List threadDeathRequests()
           
 List threadStartRequests()
           
 
Methods inherited from interface com.sun.jdi.Mirror
toString, virtualMachine
 

Method Detail

createClassPrepareRequest

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:
the created ClassPrepareRequest

createClassUnloadRequest

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:
the created ClassUnloadRequest

createThreadStartRequest

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:
the created ThreadStartRequest

createThreadDeathRequest

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:
the created ThreadDeathRequest

createExceptionRequest

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 - 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 - If true, caught exceptions will be reported.
notifyUncaught - If true, uncaught exceptions will be reported.
Returns:
the created ExceptionRequest
Throws:
VMMismatchException - if refType and this EventRequestManager do not belong to the same VirtualMachine.

createMethodEntryRequest

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:
the created MethodEntryRequest

createMethodExitRequest

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:
the created MethodExitRequest

createStepRequest

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 sizevalue 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. 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 - the thread in which to step
depth - the step depth
size - the step size
Returns:
the created StepRequest
Throws:
DuplicateRequestException - if there is already a pending step request for the specified thread.
ObjectCollectedException - if the thread object has been garbage collected.
VMMismatchException - if thread and this EventRequestManager do not belong to the same VirtualMachine.

createBreakpointRequest

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 - the location of the new breakpoint.
Returns:
the created BreakpointRequest
Throws:
NullPointerException - if location is null.
VMMismatchException - if location and this EventRequestManager do not belong to the same VirtualMachine.

createAccessWatchpointRequest

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.
Parameters:
field - the field to watch
Returns:
the created watchpoint
Throws:
NullPointerException - if field is null.
VMMismatchException - if field and this EventRequestManager do not belong to the same VirtualMachine.

createModificationWatchpointRequest

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.
Parameters:
field - the field to watch
Returns:
the created watchpoint
Throws:
NullPointerException - if field is null.
VMMismatchException - if field and this EventRequestManager do not belong to the same VirtualMachine.

deleteEventRequest

public void deleteEventRequest(EventRequest eventRequest)
Removes a eventRequest. The eventRequest is disabled and removed from the list of eventRequests managed by this EventRequestManager. Once the eventRequest is deleted, no significant operations (for example, EventRequest.setEnabled(boolean)) are permitted. No other eventRequests are effected.
Parameters:
eventRequest - the eventRequest to remove
Throws:
VMMismatchException - if a Mirror argument and this mirror do not belong to the same VirtualMachine.

deleteEventRequests

public void deleteEventRequests(List eventRequests)
Removes a list of EventRequests.
Parameters:
eventRequests - the list of eventRequests to remove
Throws:
VMMismatchException - if a Mirror argument and this mirror do not belong to the same VirtualMachine.
See Also:
deleteEventRequest(EventRequest)

deleteAllBreakpoints

public void deleteAllBreakpoints()
Remove all breakpoints managed by this EventRequestManager.
See Also:
deleteEventRequest(EventRequest)

stepRequests

public List stepRequests()
Returns:
the all StepRequest objects.

classPrepareRequests

public List classPrepareRequests()
Returns:
the all ClassPrepareRequest objects.

classUnloadRequests

public List classUnloadRequests()
Returns:
the all ClassUnloadRequest objects.

threadStartRequests

public List threadStartRequests()
Returns:
the all ThreadStartRequest objects.

threadDeathRequests

public List threadDeathRequests()
Returns:
the all ThreadDeathRequest objects.

exceptionRequests

public List exceptionRequests()
Returns:
the all ExceptionRequest objects.

breakpointRequests

public List breakpointRequests()
Returns:
the list of all BreakpointRequest objects.

accessWatchpointRequests

public List accessWatchpointRequests()
Returns:
the all AccessWatchpointRequest objects.

modificationWatchpointRequests

public List modificationWatchpointRequests()
Returns:
the all ModificationWatchpointRequest objects.

methodEntryRequests

public List methodEntryRequests()
Returns:
the list of all MethodEntryRequest objects.

methodExitRequests

public List methodExitRequests()
Returns:
the list of all MethodExitRequest objects.

Java Debug Interface