|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jde.debugger.spec.EventRequestSpec
EventRequestSpec.java
A request specification. This is used for watchpoints, exception-catches, and breakpoints, and provides a mechanism for implementing deferral.
The intuition is that the user should be allowed to specify things like breakpoints, even though the corresponding classes haven't been loaded yet.
When the user does a, for example, "break on_line test.Test 42", jdebug tries to find if test.Test has been loaded. If it has, it tries to set the breakpoint, and sends an error on failure.
If, however, no class matching test.Test exists, jdebug places this "spec" in a list, and each time a class is prepared, matches the class with the spec. If the spec matches, it tries to set the breakpoint / watchpoint / exception-catch. If it works, fine, else it sends the error over to jde.
This also allows for neat things like setting breakpoints on source file + line number combinations, since each reference type (given it was compiled with debug info) also contains the source file name in it.
Information that would normally be stuck right into the actual requests,
for example a thread filter, is stored in the spec until the time it can
resolve the request. At that time, it is set in setRequest(com.sun.jdi.request.EventRequest)
.
XXX
Note that as of now, when the doc is being written, there is no way of ascertaining if the user mistyped the referencetype name/pattern, since jdebug will just wait ad infinitum for that class to be prepared.
Created: Thu Jul 15 12:17:34 1999
Field Summary | |
(package private) Application |
app
The Application for which we're toiling so much |
private java.util.List |
classExFilters
Stores a list of class exclusion filters that are to be applied to the event request when it gets resolved. |
private java.util.List |
classFilters
Stores a list of class filters that are to be applied to the event request when it gets resolved. |
private java.lang.String |
expr
|
static java.lang.Object |
expressionKey
While setting some specs, the user is allowed to specify a boolean expression that must evaluate to true if the event is to be passed on to the user. |
(package private) boolean |
isResolved
Unlike the original javadt (from which most of the spec code comes, we do not maintain three spec states, ie, resolved, unresolved, and error. |
private java.lang.Long |
myID
|
(package private) ReferenceTypeSpec |
refSpec
The reference type spec for this event request spec: this should match the ReferenceType for the spec to be "resolved" |
(package private) com.sun.jdi.request.EventRequest |
request
The EventRequest corresponding to this spec. |
static java.lang.Object |
specPropertyKey
Used to cross-reference the EventRequest to its spec. |
private int |
suspendPolicy
Determines the suspend policy for the corresponding event. |
private java.lang.Object |
thread
|
static java.lang.Object |
threadKey
For specs that allow for it, the thread object is either null, a Long, or a
String. |
Constructor Summary | |
EventRequestSpec(Application app,
ReferenceTypeSpec refSpec)
|
Method Summary | |
(package private) void |
attemptImmediateResolve(com.sun.jdi.VirtualMachine vm)
Attempts to resolve the eventRequestSpec immediately. |
void |
attemptResolve(com.sun.jdi.ReferenceType refType)
This function is called after each new class is loaded. |
com.sun.jdi.request.EventRequest |
getEventRequest()
|
java.lang.Long |
getID()
get the id corresponding to this spec |
private void |
installClassExFilters(com.sun.jdi.request.EventRequest request)
Install class exclusion filters. |
private void |
installClassFilters(com.sun.jdi.request.EventRequest request)
Install class filters. |
(package private) boolean |
isJavaIdentifier(java.lang.String s)
|
boolean |
isResolved()
|
(package private) abstract boolean |
resolve(com.sun.jdi.ReferenceType refType)
This function is called to resolve an EventRequestSpec when
the ReferenceType is known to match
|
void |
setClassExFilters(java.util.List filters)
|
void |
setClassFilters(java.util.List filters)
|
void |
setExpression(java.lang.String expr)
|
void |
setIsResolved()
set resolved status |
(package private) void |
setRequest(com.sun.jdi.request.EventRequest request)
sets the request up. |
void |
setSuspendPolicy(int policy)
|
void |
setThread(java.lang.Object thread)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
private final java.lang.Long myID
public static final java.lang.Object expressionKey
private java.lang.String expr
public static final java.lang.Object threadKey
thread
object is either null, a Long, or a
String. Depending on the type, it is matched at the time the
breakpoint is hit. If it matches the thread, the breakpoint is
deemed non-hit.private java.lang.Object thread
private int suspendPolicy
EventHandler
for more details
Note that the request needs to be disabled for us to be able to do this
private java.util.List classFilters
Not all event-requests support class filters. This filters will be silently ignored for event-requests that do not support them.
private java.util.List classExFilters
Not all event-requests support class ex-filters. This filters will be silently ignored for event-requests that do not support them.
boolean isResolved
XXX see if the above needs to be changed
Consequently, we only need keep track of if we're resolved yet or not.
public static final java.lang.Object specPropertyKey
final Application app
ReferenceTypeSpec refSpec
com.sun.jdi.request.EventRequest request
Constructor Detail |
public EventRequestSpec(Application app, ReferenceTypeSpec refSpec)
Method Detail |
public void setExpression(java.lang.String expr)
public void setThread(java.lang.Object thread)
public void setSuspendPolicy(int policy)
public void setClassFilters(java.util.List filters)
private void installClassFilters(com.sun.jdi.request.EventRequest request)
public void setClassExFilters(java.util.List filters)
private void installClassExFilters(com.sun.jdi.request.EventRequest request)
public java.lang.Long getID()
void setRequest(com.sun.jdi.request.EventRequest request)
public com.sun.jdi.request.EventRequest getEventRequest()
abstract boolean resolve(com.sun.jdi.ReferenceType refType) throws JDEException
EventRequestSpec
when
the ReferenceType is known to match
if any errors occur at any time during resolution of the event-
requestspec, it's entry in the EventRequestSpecList
is
removed, and jde
informed about it (through
Application.removeSpecAndInformJDE(jde.debugger.spec.EventRequestSpec, java.lang.String)
public void attemptResolve(com.sun.jdi.ReferenceType refType)
attemptImmediateResolve(com.sun.jdi.VirtualMachine)
Important Note: This method will always go through without raising any exceptions. As a result of trying to resolve, an exception might be raised, but that'll only result in the removal of the erring spec from the list, and possibly a message to the jde.
void attemptImmediateResolve(com.sun.jdi.VirtualMachine vm)
public boolean isResolved()
public void setIsResolved()
boolean isJavaIdentifier(java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |