Interface ArtemisExecutor

All Superinterfaces:
Executor
All Known Implementing Classes:
OrderedExecutor

public interface ArtemisExecutor extends Executor
  • Method Summary

    Modifier and Type
    Method
    Description
    delegate(Executor executor)
    Artemis is supposed to implement this properly, however in tests or tools this can be used as a fake, doing a simple delegate and using the default methods implemented here.
    default boolean
    flush(long timeout, TimeUnit unit)
    To be used to flush an executor from a different thread.
    default boolean
     
    default boolean
     
    default boolean
    This will verify if the executor is flushed with no wait (or very minimal wait if not the OrderedExecutor
    setFair(boolean fair)
    If this OrderedExecutor is fair, it will yield for another executors after each task ran
    default void
     
    default int
    It will wait the current execution (if there is one) to finish but will not complete any further executions
    default int
    shutdownNow(Consumer<? super Runnable> onPendingTask, int timeout, TimeUnit unit)
    It will wait the current execution (if there is one) to finish but will not complete any further executions.
    default void
    It will give up the executor loop, giving a chance to other OrderedExecutors to run

    Methods inherited from interface java.util.concurrent.Executor

    execute
  • Method Details

    • delegate

      static ArtemisExecutor delegate(Executor executor)
      Artemis is supposed to implement this properly, however in tests or tools this can be used as a fake, doing a simple delegate and using the default methods implemented here.
    • shutdownNow

      default int shutdownNow(Consumer<? super Runnable> onPendingTask, int timeout, TimeUnit unit)
      It will wait the current execution (if there is one) to finish but will not complete any further executions.
      Parameters:
      onPendingTask - it will be called for each pending task found
      Returns:
      the number of pending tasks that won't be executed
    • inHandler

      default boolean inHandler()
    • flush

      default boolean flush(long timeout, TimeUnit unit)
      To be used to flush an executor from a different thread. WARNING: Do not call this within the executor. That would be stoopid ;)
    • shutdownNow

      default int shutdownNow()
      It will wait the current execution (if there is one) to finish but will not complete any further executions
    • shutdown

      default void shutdown()
    • yield

      default void yield()
      It will give up the executor loop, giving a chance to other OrderedExecutors to run
    • isFair

      default boolean isFair()
    • setFair

      default ArtemisExecutor setFair(boolean fair)
      If this OrderedExecutor is fair, it will yield for another executors after each task ran
    • isFlushed

      default boolean isFlushed()
      This will verify if the executor is flushed with no wait (or very minimal wait if not the OrderedExecutor