org.cip4.jdflib.util.thread
Class OrderedTaskQueue

java.lang.Object
  extended by java.lang.Thread
      extended by org.cip4.jdflib.util.thread.OrderedTaskQueue
All Implemented Interfaces:
Runnable

public class OrderedTaskQueue
extends Thread

class to run heavy tasks one at a time

Author:
Rainer Prosi, Heidelberger Druckmaschinen *

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
 
Method Summary
static OrderedTaskQueue getCreateQueue(String name)
          grab the queue
 boolean queue(Runnable task)
           
 void run()
           
 void shutDown()
           
static void shutDownAll()
           
 int size()
          size of the waiting queue
 String toString()
           
 
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, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCreateQueue

public static OrderedTaskQueue getCreateQueue(String name)
grab the queue

Parameters:
name - - must not be null
Returns:
the queue to fill with tasks

shutDownAll

public static void shutDownAll()

shutDown

public void shutDown()

size

public int size()
size of the waiting queue

Returns:

queue

public boolean queue(Runnable task)
Parameters:
task - the thing to send off
Returns:
true if successfully queued

run

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

toString

public String toString()
Overrides:
toString in class Thread
Returns:
See Also:
Thread.toString()


Copyright © 2013. All Rights Reserved.