Class AbstractQueuingExecutor

java.lang.Object
tigase.pubsub.utils.executors.AbstractQueuingExecutor
All Implemented Interfaces:
tigase.kernel.beans.UnregisterAware, Executor
Direct Known Subclasses:
RateLimitingExecutor

public class AbstractQueuingExecutor extends Object implements Executor, tigase.kernel.beans.UnregisterAware
Abstract class providing implementation of executor supporting task queueing and prioritization.
  • Field Details

  • Constructor Details

    • AbstractQueuingExecutor

      public AbstractQueuingExecutor()
  • Method Details

    • isOverloaded

      public boolean isOverloaded()
      Description copied from interface: Executor
      Checks if executor is overloaded. If returns true, then you should not try to submit any new tasks for a while.
      Specified by:
      isOverloaded in interface Executor
      Returns:
      true - executor is overloaded
    • submit

      public void submit(Executor.Priority priority, Runnable runnable)
      Description copied from interface: Executor
      Submits a task with a priority for execution.
      Specified by:
      submit in interface Executor
    • beforeUnregister

      public void beforeUnregister()
      Specified by:
      beforeUnregister in interface tigase.kernel.beans.UnregisterAware
    • execute

      protected void execute() throws InterruptedException
      Method called by subclass to execute a single task from the queue or wait for any task to appear.
      Throws:
      InterruptedException