de.enough.polish.processing
Class ProcessingThread

java.lang.Object
  extended by java.lang.Thread
      extended by de.enough.polish.processing.ProcessingThread
All Implemented Interfaces:
Runnable

public class ProcessingThread
extends Thread
implements Runnable

Implements a thread that is responsible for managing all Processing related activities and events. The thread automatically starts when there is at least one Processing object in the Processing objects list and automatically stops when the object list is empty.

Author:
Ovidiu Iliescu

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected static Vector events
           
protected static Vector objects
           
protected static Thread thread
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProcessingThread()
           
 
Method Summary
static void addProcessingObject(ProcessingInterface object)
          Add a new Processing object to the internal Processing objects list.
static void queueEvent(ProcessingEvent event)
          Queue an event
static void removeProcessingObject(ProcessingInterface object)
          Remove a processing object from the internal list.
 void run()
          The actual code of the thread.
protected static void startThread(Runnable object)
          Start a new thread
 
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

objects

protected static Vector objects

events

protected static Vector events

thread

protected static Thread thread
Constructor Detail

ProcessingThread

public ProcessingThread()
Method Detail

addProcessingObject

public static void addProcessingObject(ProcessingInterface object)
Add a new Processing object to the internal Processing objects list.

Parameters:
object -

queueEvent

public static void queueEvent(ProcessingEvent event)
Queue an event

Parameters:
event - the event to queue

removeProcessingObject

public static void removeProcessingObject(ProcessingInterface object)
Remove a processing object from the internal list.

Parameters:
object - the processing object to remove

startThread

protected static void startThread(Runnable object)
Start a new thread

Parameters:
object - the runnable object which should run in a new thread

run

public void run()
The actual code of the thread.

Specified by:
run in interface Runnable
Overrides:
run in class Thread