Class CommandServiceImpl
java.lang.Object
ch.tocco.nice2.persist.core.impl.exec.CommandServiceImpl
- All Implemented Interfaces:
CommandService
-
Constructor Summary
ConstructorDescriptionCommandServiceImpl
(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 TypeMethodDescriptionvoid
addListener
(CommandServiceListener listener) protected void
finalize()
void
removeListener
(CommandServiceListener listener) void
submit
(Mode<E> mode, PersistTask<A, T> task, A arg) Submits the persist tasks for execution in a separate thread returning aListenableFuture
exposing 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, com.google.common.util.concurrent.ListenableFuture<Optional<T>> submitE extends Exception> (Mode<E> mode, PersistTask<A, T> task, @Nullable A arg) Description copied from interface:CommandService
Submits the persist tasks for execution in a separate thread returning aListenableFuture
exposing 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:
submit
in interfaceCommandService
- Parameters:
mode
- the mode used for executiontask
- the task to execute asynchronouslyarg
- the argument that is passed to the task
-
addListener
- Specified by:
addListener
in interfaceCommandService
-
removeListener
- Specified by:
removeListener
in interfaceCommandService
-