Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
DEF_QUEUE_SIZE
Default queue size.
|
static long |
DEF_SLEEP_TIME
Default time to sleep.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker)
Shortest queued processor constructor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
int aQueueSize,
org.slf4j.Logger aLog)
Creates a new QueuedProcessor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
int aQueueSize,
long aSleepTime,
org.slf4j.Logger aLog)
Creates a new QueuedProcessor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
IQueueFactory<T> aQueueFactory)
Creates a new QueuedProcessor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
IQueueFactory<T> aQueueFactory,
int aQueueSize,
long aSleepTime,
org.slf4j.Logger aLog)
Creates a new QueuedProcessor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
IQueueFactory<T> aQueueFactory,
org.slf4j.Logger aLog)
Creates a new QueuedProcessor.
|
QueuedProcessor(String aName,
IQueueWorker<T> aWorker,
org.slf4j.Logger aLog)
Creates a new QueuedProcessor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToQueue(T aElement)
Default method to add an element to the queue.
|
void |
addToQueueAndWait(T element)
Inserts the specified element at the tail of the processing queue, waiting if
necessary for space in the queue to become available
|
void |
addToQueueDontWait(T aElement)
Inserts the specified element at the tail of the processing queue if the queue is not full
|
IQueueFactory<T> |
getQueueFactory() |
int |
getQueueOverflowCount() |
int |
getQueueSize() |
String |
getStatsString() |
int |
getThrowAwayCount() |
boolean |
isStopped() |
void |
logOutInfo() |
void |
reset()
Resets the queue.
|
void |
run() |
void |
setQueueFactory(IQueueFactory<T> queueFactory) |
void |
stopImmediately()
Sends signal to stop the QueueProcessor running Thread after working current element.
|
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, yieldpublic static final long DEF_SLEEP_TIME
public static final int DEF_QUEUE_SIZE
public QueuedProcessor(String aName, IQueueWorker<T> aWorker, IQueueFactory<T> aQueueFactory, int aQueueSize, long aSleepTime, org.slf4j.Logger aLog)
aName - name of the processor.aWorker - worker for the queued processor.aQueueFactory - factory to create the underlying queue.aQueueSize - size of the queue.aSleepTime - sleep time in case of an overflow.aLog - logger for output.public QueuedProcessor(String aName, IQueueWorker<T> aWorker, IQueueFactory<T> aQueueFactory, org.slf4j.Logger aLog)
aName - name of the processor.aWorker - worker for the queued processor.aQueueFactory - factory to create the underlying queue.aLog - logger for output.public QueuedProcessor(String aName, IQueueWorker<T> aWorker, int aQueueSize, long aSleepTime, org.slf4j.Logger aLog)
aName - name of the processor.aWorker - worker for the queued processor.aQueueSize - size of the queue.aSleepTime - sleep time in case of an overflow.aLog - logger for output.public QueuedProcessor(String aName, IQueueWorker<T> aWorker, int aQueueSize, org.slf4j.Logger aLog)
aName - name of the processor.aWorker - worker for the queued processor.aQueueSize - size of the queue.aLog - logger for output.public QueuedProcessor(String aName, IQueueWorker<T> aWorker, org.slf4j.Logger aLog)
aName - name of the processor.aWorker - worker for the queued processor.aLog - logger for output.public QueuedProcessor(String aName, IQueueWorker<T> aWorker, IQueueFactory<T> aQueueFactory)
aName - name of the processor.aWorker - worker for the queued processor.public QueuedProcessor(String aName, IQueueWorker<T> aWorker)
aName - name of the processor.aWorker - worker for the queued processor.public void reset()
public void addToQueueAndWait(T element)
element - the element to addpublic void addToQueue(T aElement) throws UnrecoverableQueueOverflowException
aElement - UnrecoverableQueueOverflowException - if the processing queue is full.public void addToQueueDontWait(T aElement) throws UnrecoverableQueueOverflowException
aElement - UnrecoverableQueueOverflowException - if the processing queue is full.public void stopImmediately()
public boolean isStopped()
public int getQueueOverflowCount()
public int getQueueSize()
public int getThrowAwayCount()
public String getStatsString()
public void logOutInfo()
public IQueueFactory<T> getQueueFactory()
public void setQueueFactory(IQueueFactory<T> queueFactory)
Copyright © 2010-2014 anotheria.net. All Rights Reserved.