Package tigase.util.processing
Class WorkerThread
- java.lang.Object
-
- java.lang.Thread
-
- tigase.util.processing.WorkerThread
-
- All Implemented Interfaces:
java.lang.Runnable
public abstract class WorkerThread extends java.lang.ThreadCreated: Apr 21, 2009 9:02:57 PM- Author:
- Artur Hefczyc
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.logging.Loggerlog
-
Constructor Summary
Constructors Constructor Description WorkerThread()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetAverageProcessingTime()abstract WorkerThreadgetNewInstance()longgetRunsCounter()booleanoffer(QueueItem item)abstract voidprocess(QueueItem item)voidrun()voidsetQueueMaxSize(int maxSize)voidshutdown()intsize()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
getNewInstance
public abstract WorkerThread getNewInstance()
-
process
public abstract void process(QueueItem item)
-
getAverageProcessingTime
public long getAverageProcessingTime()
-
getRunsCounter
public long getRunsCounter()
-
offer
public boolean offer(QueueItem item)
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
setQueueMaxSize
public void setQueueMaxSize(int maxSize)
-
size
public int size()
-
shutdown
public void shutdown()
-
-