Interface CommandService

All Known Implementing Classes:
CommandServiceImpl

public interface CommandService
A executor service like CommandExecutor but submitting the given task for asynchronous execution instead of executing it on the behalf of the calling thread.
  • Method Details

    • submit

      <A, T, E extends Exception> com.google.common.util.concurrent.ListenableFuture<Optional<T>> submit(Mode<E> mode, PersistTask<A,T> task, @Nullable A arg)
      Submits the persist tasks for execution in a separate thread returning a ListenableFuture exposing control methods. The task is executed exactly as CommandExecutor.perform(Mode, PersistTask, Object).

      By default, the security context of the calling thread is restored for the thread executing the persist task.

      Parameters:
      mode - the mode used for execution
      task - the task to execute asynchronously
      arg - the argument that is passed to the task
    • addListener

      void addListener(CommandServiceListener listener)
    • removeListener

      void removeListener(CommandServiceListener listener)