com.partnersoft.v3x.io
Class ProcessingQueue

java.lang.Object
  extended by java.lang.Thread
      extended by com.partnersoft.v3x.io.ProcessingQueue
All Implemented Interfaces:
java.lang.Runnable

public abstract class ProcessingQueue
extends java.lang.Thread

A little processing queue with its own thread. Just sits and blocks until there is something to do, then does it, lah de dah.


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
ProcessingQueue()
           
ProcessingQueue(java.lang.String name)
           
 
Method Summary
 void addItem(java.lang.Object newItem)
          Adds an item to the queue.
 void close()
          Finishes up and stops thread.
abstract  void processItem(java.lang.Object nextItem)
          Subclasses just implement this to handle items to be processed.
 void run()
           
 void sync()
          Blocks until queue is empty.
 
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
 

Constructor Detail

ProcessingQueue

public ProcessingQueue()

ProcessingQueue

public ProcessingQueue(java.lang.String name)
Method Detail

processItem

public abstract void processItem(java.lang.Object nextItem)
Subclasses just implement this to handle items to be processed.


sync

public void sync()
Blocks until queue is empty.


close

public void close()
Finishes up and stops thread.


addItem

public void addItem(java.lang.Object newItem)
Adds an item to the queue.


run

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