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 Summary
Modifier and TypeMethodDescriptionvoidaddListener(CommandServiceListener listener) voidremoveListener(CommandServiceListener listener) submit(Mode<E> mode, PersistTask<A, T> task, A arg) Submits the persist tasks for execution in a separate thread returning aListenableFutureexposing control methods.
-
Method Details
-
submit
<A,T, com.google.common.util.concurrent.ListenableFuture<Optional<T>> submitE extends Exception> (Mode<E> mode, PersistTask<A, T> task, @Nullable A arg) Submits the persist tasks for execution in a separate thread returning aListenableFutureexposing control methods. The task is executed exactly asCommandExecutor.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 executiontask- the task to execute asynchronouslyarg- the argument that is passed to the task
-
addListener
-
removeListener
-