|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
edu.rice.cs.drjava.model.debug.jpda.EventHandlerThread
public class EventHandlerThread
A thread that listens and responds to events from JPDA when the debugger has attached to another JVM.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private boolean |
_connected
Whether this event handler is currently connected to the JPDA VirtualMachine. |
private JPDADebugger |
_debugger
Debugger to which this class reports events. |
private static Log |
_log
A log for recording messages in a file. |
private com.sun.jdi.VirtualMachine |
_vm
JPDA reference to the VirtualMachine generating the events. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
EventHandlerThread(JPDADebugger debugger,
com.sun.jdi.VirtualMachine vm)
Creates a new EventHandlerThread to listen to events from the given debugger and virtual machine. |
|
| Method Summary | |
|---|---|
private void |
_cleanUp(com.sun.jdi.event.Event e)
Cleans up the state after the virtual machine being debugged dies or disconnects. |
private void |
_handleBreakpointEvent(com.sun.jdi.event.BreakpointEvent e)
Responds to a breakpoint event. |
private void |
_handleClassPrepareEvent(com.sun.jdi.event.ClassPrepareEvent e)
Responds when a class of interest has been prepared. |
private void |
_handleStepEvent(com.sun.jdi.event.StepEvent e)
Responds to a step event. |
private void |
_handleThreadDeathEvent(com.sun.jdi.event.ThreadDeathEvent e)
Reponds to a thread death event. |
private void |
_handleThreadStartEvent(com.sun.jdi.event.ThreadStartEvent e)
Responds to a thread start event. |
private void |
_handleVMDeathEvent(com.sun.jdi.event.VMDeathEvent e)
Responds if the virtual machine being debugged dies. |
private void |
_handleVMDisconnectEvent(com.sun.jdi.event.VMDisconnectEvent e)
Responds if the virtual machine being debugged disconnects. |
private boolean |
_isSuspendedWithFrames(com.sun.jdi.ThreadReference thread)
Returns whether the given thread is both suspended and has stack frames. |
private void |
_log(String message)
Logs any unexpected behavior that occurs (but which should not cause DrJava to abort). |
private void |
_log(String message,
Throwable t)
Logs any unexpected behavior that occurs (but which should not cause DrJava to abort). |
private void |
handleDisconnectedException()
Responds when a VMDisconnectedException occurs while dealing with another event. |
private void |
handleEvent(com.sun.jdi.event.Event e)
Processes a given event from JPDA. |
void |
run()
Continually consumes events from the VM's event queue until it is disconnected. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final JPDADebugger _debugger
private final com.sun.jdi.VirtualMachine _vm
private volatile boolean _connected
private static final Log _log
| Constructor Detail |
|---|
EventHandlerThread(JPDADebugger debugger,
com.sun.jdi.VirtualMachine vm)
debugger - Debugger to which to report eventsvm - JPDA reference to the VirtualMachine generating the events| Method Detail |
|---|
private void _log(String message)
message - message to print to the log
private void _log(String message,
Throwable t)
message - message to print to the logt - Exception or Error being loggedpublic void run()
run in interface Runnablerun in class Thread
private void handleEvent(com.sun.jdi.event.Event e)
throws DebugException
DebugException
private boolean _isSuspendedWithFrames(com.sun.jdi.ThreadReference thread)
throws DebugException
DebugExceptionprivate void _handleBreakpointEvent(com.sun.jdi.event.BreakpointEvent e)
e - breakpoint event from JPDAprivate void _handleStepEvent(com.sun.jdi.event.StepEvent e)
e - step event from JPDAprivate void _handleClassPrepareEvent(com.sun.jdi.event.ClassPrepareEvent e)
e - class prepare event from JPDAprivate void _handleThreadStartEvent(com.sun.jdi.event.ThreadStartEvent e)
e - thread start event from JPDAprivate void _handleThreadDeathEvent(com.sun.jdi.event.ThreadDeathEvent e)
e - thread death event from JPDA
private void _handleVMDeathEvent(com.sun.jdi.event.VMDeathEvent e)
throws DebugException
e - virtual machine death event from JPDA
DebugException
private void _handleVMDisconnectEvent(com.sun.jdi.event.VMDisconnectEvent e)
throws DebugException
e - virtual machine disconnect event from JPDA
DebugException
private void _cleanUp(com.sun.jdi.event.Event e)
throws DebugException
e - JPDA event indicating the debugging session has ended
DebugException
private void handleDisconnectedException()
throws DebugException
DebugException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||