Class DirectExecutor

  • All Implemented Interfaces:
    Executor

    public class DirectExecutor
    extends Object
    implements Executor
    Performs direct, synchronous runnable task execution in the current thread. This class allows an application to maintain an java.util.Executor reference and instantiate the appropriate executor subclass which performs either synchronous or asynchronous execution. The application can switch between different task execution styles without changing how it uses the Executor instance.

    (Aside: this class should be in java.util.concurrent to provide a complete Executor implementation suite but is not part of the standard Java class library. Hence it being part of the eBus library).

    Author:
    Charles Rapp
    • Constructor Detail

      • DirectExecutor

        public DirectExecutor()
    • Method Detail

      • execute

        public void execute​(Runnable task)
        Immediately executes the task in the current thread.
        Specified by:
        execute in interface Executor
        Parameters:
        task - Execute this task.