jmusic.jdi
Class EventHandlerThread

java.lang.Object
  extended by java.lang.Thread
      extended by jmusic.jdi.EventHandlerThread
All Implemented Interfaces:
java.lang.Runnable

public class EventHandlerThread
extends java.lang.Thread

This thread keeps querying the JDI event queue and sending the resulting events out to all the JDIHandlers. The JDI program is considered done when the EventHandlerThread detects a VMDeathEvent or VMDisconnectEvent, and then sends it out.

Author:
steppm

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventHandlerThread(com.sun.jdi.VirtualMachine _vm, EventHandler[] _handlers)
          Constructor.
 
Method Summary
 void kill()
          Forcably make this class stop running.
 void run()
          The main loop of this class.
static com.sun.jdi.event.Event wrapEvent(com.sun.jdi.event.Event e)
           
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventHandlerThread

public EventHandlerThread(com.sun.jdi.VirtualMachine _vm,
                          EventHandler[] _handlers)
Constructor.

Parameters:
_vm - the JDI VirtualMachine instance.
_method_begin_set - a set of MemberIDs for MethodEntryEvents that we wish to catch
_method_end_set - a set of MemberIDs for MethodExitEvents we wish to catch
_field_access_set - a set of MemberIDs for AccessWatchpointEvents we wish to catch
_field_modify_set - a set of MemberIDs for ModificationWatchpointEvents we wish to catch
_exception_set - a set of strings for exceptions we wish to catch
_handlers - the list of JDIHandlers that this class will send events to
Method Detail

kill

public void kill()
Forcably make this class stop running. This will be in response to a UI command, for instance.


wrapEvent

public static com.sun.jdi.event.Event wrapEvent(com.sun.jdi.event.Event e)

run

public void run()
The main loop of this class. This continually polls the JDI for events and if there are any it sends them out to the handlers.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread