Class QueueWorker<E>

All Implemented Interfaces:
INotifier, INotifier.INotifier2, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation
Direct Known Subclasses:
QueueRunner, QueueRunner2

public abstract class QueueWorker<E> extends Worker
Since:
2.0
Author:
Eike Stepper
  • Field Details

    • DEFAULT_POLL_MILLIS

      public static final int DEFAULT_POLL_MILLIS
      Since:
      3.2
      See Also:
  • Constructor Details

    • QueueWorker

      public QueueWorker()
  • Method Details

    • 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)
    • noWork

      protected void noWork(Worker.WorkContext context)
      Since:
      3.3
    • createQueue

      protected BlockingQueue<E> createQueue()
    • doRemainingWorkBeforeDeactivate

      protected boolean doRemainingWorkBeforeDeactivate()
      Since:
      3.1
    • doDeactivate

      protected void doDeactivate() throws Exception
      Overrides:
      doDeactivate in class Worker
      Throws:
      Exception