com.github.croesch.micro_debug.gui.commons
Class WorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.github.croesch.micro_debug.gui.commons.WorkerThread
All Implemented Interfaces:
Runnable

public final class WorkerThread
extends Thread

A thread that is able to execute Runnables until being interrupted.

Since:
Date: May 26, 2012
Author:
croesch

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WorkerThread(String name)
          Constructs this thread with the given name.
 
Method Summary
 void invokeLater(Runnable r)
          Adds the given Runnable to the execution queue.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkerThread

public WorkerThread(String name)
Constructs this thread with the given name.

Parameters:
name - the name of this thread
Since:
Date: May 26, 2012
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

invokeLater

public void invokeLater(Runnable r)
Adds the given Runnable to the execution queue. There is no guarantee that the Runnable will be executed. For example no further Runnables will be executed, if the thread has been marked as interrupted.

Parameters:
r - the Runnable to execute on this thread.
Since:
Date: May 26, 2012


Copyright © 2012. All Rights Reserved.