Class SameThreadExecutor

  • All Implemented Interfaces:
    Executor

    public class SameThreadExecutor
    extends java.lang.Object
    implements Executor
    Implementation of Executor providing no limitations and no support for priorities. Just executes submitted task on the same thread as they were submitted.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isOverloaded()
      Checks if executor is overloaded.
      void submit​(Executor.Priority priority, java.lang.Runnable runnable)
      Submits a task with a priority for execution.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SameThreadExecutor

        public SameThreadExecutor()
    • Method Detail

      • 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,
                           java.lang.Runnable runnable)
        Description copied from interface: Executor
        Submits a task with a priority for execution.
        Specified by:
        submit in interface Executor