org.eclipse.net4j.util.concurrent
Class QueueWorker<E>
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.util.concurrent.Worker
org.eclipse.net4j.util.concurrent.QueueWorker<E>
- All Implemented Interfaces:
- INotifier, ILifecycle, ILifecycle.DeferrableActivation
- Direct Known Subclasses:
- QueueRunner
- public abstract class QueueWorker<E>
- extends Worker
- Since:
- 2.0
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString |
DEFAULT_POLL_MILLIS
public static final int DEFAULT_POLL_MILLIS
- Since:
- 3.2
- See Also:
- Constant Field Values
QueueWorker
public QueueWorker()
getPollMillis
public long getPollMillis()
setPollMillis
public void setPollMillis(long pollMillis)
clearQueue
public void clearQueue()
- Since:
- 3.0
addWork
public boolean addWork(E element)
work
protected void work(Worker.WorkContext context)
throws Exception
- Specified by:
work
in class Worker
- Throws:
Exception
work
protected abstract void work(Worker.WorkContext context,
E element)
createQueue
protected BlockingQueue<E> createQueue()
doRemainingWorkBeforeDeactivate
protected boolean doRemainingWorkBeforeDeactivate()
- Since:
- 3.1
doActivate
protected void doActivate()
throws Exception
- Overrides:
doActivate
in class Worker
- Throws:
Exception
doDeactivate
protected void doDeactivate()
throws Exception
- Overrides:
doDeactivate
in class Worker
- Throws:
Exception
Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.