
public abstract class QueueWorker<E> extends Worker
Worker.WorkContextILifecycle.DeferrableActivation| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POLL_MILLIS |
DEFAULT_ERROR_HANDLER, DEFAULT_TIMEOUT| Constructor and Description |
|---|
QueueWorker() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addWork(E element) |
void |
clearQueue() |
protected BlockingQueue<E> |
createQueue() |
protected void |
doDeactivate() |
protected boolean |
doRemainingWorkBeforeDeactivate() |
long |
getPollMillis() |
protected void |
noWork(Worker.WorkContext context) |
void |
setPollMillis(long pollMillis) |
protected void |
work(Worker.WorkContext context) |
protected abstract void |
work(Worker.WorkContext context,
E element) |
doActivate, getActivationTimeout, getDeactivationTimeout, getGlobalErrorHandler, getThreadName, handleError, isDaemon, setActivationTimeout, setDaemon, setDeactivationTimeout, setGlobalErrorHandleractivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringaddListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getListeners, hasListeners, removeListenerpublic static final int DEFAULT_POLL_MILLIS
public long getPollMillis()
public void setPollMillis(long pollMillis)
public void clearQueue()
public boolean addWork(E element)
protected void work(Worker.WorkContext context) throws Exception
protected abstract void work(Worker.WorkContext context, E element)
protected void noWork(Worker.WorkContext context)
protected BlockingQueue<E> createQueue()
protected boolean doRemainingWorkBeforeDeactivate()
protected void doDeactivate()
throws Exception
doDeactivate in class WorkerExceptionCopyright (c) 2011-2014 Eike Stepper (Berlin, Germany) and others.