"

2013 FRC Java API

"

com.sun.squawk.debugger
Class EventRequest

java.lang.Object
  extended by com.sun.squawk.debugger.EventRequest

public abstract class EventRequest
extends Object

An EventRequest instance is used register a request for notification of a particular event on behalf of a debugger. Events are requested by the debugger client, which also sends an event request ID. This ID is used to enable the debugger to clear event requests. Events can be be filtered on the VM so that only certian class load events, or method entry events (etc) are actually sent to the debugger client. These filters are described as "modifiers" in the event request, and are modelled by the Modifier class.


Field Summary
 int id
          Used by debugger to cancel requests.
 int kind
          The JDWP.EventKind constant for the event being monitored.
 EventRequestModifier[] modifiers
          List of modifiers that filter out certain events.
 int suspendPolicy
          Should the current thread, all (isolate) threads, or no threads be suspended when the event occurs.
 
Constructor Summary
protected EventRequest(int kind, int suspendPolicy)
          Creates an EventRequest.
protected EventRequest(int id, PacketInputStream in, int kind)
          Creates an EventRequest based on the data read from a JDWP packet.
 
Method Summary
 void cleared()
          Does any event specific clearing after it has been de-registered from an event manager.
static String getNameForJDWPEventKind(int eventKind)
          Gets the name string corresponding to a given JDWP.EventKind constant.
static String getNameForJDWPSuspendPolicy(int policy)
          Gets the name string corresponding to a given JDWP.SuspendPolicy constant.
 boolean matchKind(int eventKind)
          Determines if this request may match events of a given kind.
 boolean matchModifiers(EventRequestModifier.Matcher matcher, Debugger.Event event)
          Determines if all the modifiers of this request match a given event.
protected  EventRequestModifier readModifier(PacketInputStream in, int kind)
          Creates a EventRequestModifier from a given PacketInputStream.
 void registered()
          Does any event specific setup after it has been registered with an event manager.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public final int kind
The JDWP.EventKind constant for the event being monitored.


suspendPolicy

public final int suspendPolicy
Should the current thread, all (isolate) threads, or no threads be suspended when the event occurs. See JDWP.SuspendPolicy


id

public final int id
Used by debugger to cancel requests. An ID of zero indicates an automatic event that can't be cleared.


modifiers

public final EventRequestModifier[] modifiers
List of modifiers that filter out certain events.

Constructor Detail

EventRequest

protected EventRequest(int kind,
                       int suspendPolicy)
Creates an EventRequest.

Parameters:
kind - the JDWP.EventKind to create
suspendPolicy - the suspend policy to use

EventRequest

protected EventRequest(int id,
                       PacketInputStream in,
                       int kind)
                throws SDWPException,
                       IOException
Creates an EventRequest based on the data read from a JDWP packet.

Parameters:
in - the PacketInputStream to read the request details from
vm - the VM being debugged
kind - the JDWP.EventKind to create
Throws:
SDWPException - if the request is invalid
IOException - if there was an IO error reading the request
Method Detail

matchKind

public boolean matchKind(int eventKind)
Determines if this request may match events of a given kind.

Parameters:
eventKind - the event kind to query
Returns:
true if this event request may match eventKind events

matchModifiers

public boolean matchModifiers(EventRequestModifier.Matcher matcher,
                              Debugger.Event event)
Determines if all the modifiers of this request match a given event.

Parameters:
event - the details and thread context of the event
Returns:
true if all the modifiers of this request match the given event

registered

public void registered()
Does any event specific setup after it has been registered with an event manager.

Parameters:
vm - the VM being debugged

cleared

public void cleared()
Does any event specific clearing after it has been de-registered from an event manager.

Parameters:
vm - the VM being debugged

readModifier

protected EventRequestModifier readModifier(PacketInputStream in,
                                            int kind)
                                     throws SDWPException,
                                            IOException
Creates a EventRequestModifier from a given PacketInputStream.

Parameters:
in - the PacketInputStream
kind - the kind of event request object that the modifier applies to
Returns:
the created EventRequestModifier
Throws:
SDWPException - if the data read from in is invalid or not well formed
IOException - if there is an IO error reading from in

getNameForJDWPEventKind

public static String getNameForJDWPEventKind(int eventKind)
Gets the name string corresponding to a given JDWP.EventKind constant.

Parameters:
eventKind - the constant to translate
Returns:
the name of the event kind, or null if no translation exists

getNameForJDWPSuspendPolicy

public static String getNameForJDWPSuspendPolicy(int policy)
Gets the name string corresponding to a given JDWP.SuspendPolicy constant.

Parameters:
policy - the JDWP.SuspendPolicy to translate
Returns:
the name of the SuspendPolicy, or null if policy is invalid.

toString

public String toString()
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"