Class CommandServiceImpl
java.lang.Object
ch.tocco.nice2.persist.core.impl.exec.CommandServiceImpl
- All Implemented Interfaces:
CommandService
-
Constructor Summary
ConstructorsConstructorDescriptionCommandServiceImpl(org.slf4j.Logger log, PersistTaskRunner runner, Mode.Key<Boolean> modesApplied, ModeHandler handler, ExecutorService executorService, ContextManager contextManager, ThreadHandlerManager threadHandlerManager, L10N l10N, List<CommandServiceListener> listeners) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(CommandServiceListener listener) protected voidfinalize()voidremoveListener(CommandServiceListener listener) voidsubmit(Mode<E> mode, PersistTask<A, T> task, A arg) Submits the persist tasks for execution in a separate thread returning aListenableFutureexposing control methods.
-
Constructor Details
-
CommandServiceImpl
public CommandServiceImpl(org.slf4j.Logger log, PersistTaskRunner runner, Mode.Key<Boolean> modesApplied, ModeHandler handler, ExecutorService executorService, ContextManager contextManager, ThreadHandlerManager threadHandlerManager, L10N l10N, List<CommandServiceListener> listeners)
-
-
Method Details
-
shutdown
-
finalize
-
submit
public <A, T, E extends Exception> com.google.common.util.concurrent.ListenableFuture<Optional<T>> submit(Mode<E> mode, PersistTask<A, T> task, @Nullable A arg) Description copied from interface:CommandServiceSubmits 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.
- Specified by:
submitin interfaceCommandService- Parameters:
mode- the mode used for executiontask- the task to execute asynchronouslyarg- the argument that is passed to the task
-
addListener
- Specified by:
addListenerin interfaceCommandService
-
removeListener
- Specified by:
removeListenerin interfaceCommandService
-