Class DirectExecutor

java.lang.Object
org.axonframework.common.DirectExecutor
All Implemented Interfaces:
Executor

public final class DirectExecutor extends Object implements Executor
Simple executor implementation that runs a given Runnable immediately in the calling thread.
Since:
0.7
Author:
Allard Buijze
  • Field Details

    • INSTANCE

      public static final DirectExecutor INSTANCE
      Returns a singleton instance of the DirectExecutor. Using this constant prevents the creation of unnecessary DirectExecutor instances.
  • Method Details

    • instance

      public static DirectExecutor instance()
      Returns the (singleton) instance of the DirectExecutor
      Returns:
      the one and only DirectExecutor
    • execute

      public void execute(Runnable command)
      Executes the given command immediately in the current thread.
      Specified by:
      execute in interface Executor
      Parameters:
      command - the command to execute.