edu.rice.cs.drjava.model.debug.jpda
Class PendingRequestManager

java.lang.Object
  extended by edu.rice.cs.drjava.model.debug.jpda.PendingRequestManager

public class PendingRequestManager
extends Object

Keeps track of DocumentDebugActions that are waiting to be resolved when the classes they corresponed to are prepared. (Only DocumentDebugActions have reference types which can be prepared.)

Version:
$Id: PendingRequestManager.java 4691 2008-12-02 23:33:27Z dlsmith $

Constructor Summary
PendingRequestManager(JPDADebugger manager)
           
 
Method Summary
 void addPendingRequest(DocumentDebugAction<?> action)
          Called if a breakpoint is set before its class is prepared
 void classPrepared(com.sun.jdi.event.ClassPrepareEvent event)
          Called by the EventHandler whenever a ClassPrepareEvent occurs.
 void removePendingRequest(DocumentDebugAction<?> action)
          Called if a breakpoint is set and removed before its class is prepared
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingRequestManager

public PendingRequestManager(JPDADebugger manager)
Method Detail

addPendingRequest

public void addPendingRequest(DocumentDebugAction<?> action)
Called if a breakpoint is set before its class is prepared

Parameters:
action - The DebugAction that is pending

removePendingRequest

public void removePendingRequest(DocumentDebugAction<?> action)
Called if a breakpoint is set and removed before its class is prepared

Parameters:
action - The DebugAction that was set and removed

classPrepared

public void classPrepared(com.sun.jdi.event.ClassPrepareEvent event)
                   throws DebugException
Called by the EventHandler whenever a ClassPrepareEvent occurs. This will take the event, get the class that was prepared, lookup the Vector of DebugAction that was waiting for this class's preparation, iterate through this Vector, and attempt to create the Breakpoints that were pending. Since the keys to the Hashtable are the names of the outer class, the $ and everything after it must be cropped off from the class name in order to do the lookup. During the lookup, however, the line number of each action is checked to see if the line number is contained in the given event's ReferenceType. If not, we ignore that pending action since it is not in the class that was just prepared, but may be in one of its inner classes.

Parameters:
event - The ClassPrepareEvent that just occured
Throws:
DebugException