Interface CommandContext
public interface CommandContext
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current persist context in use.Mode<?> getMode()Returns the mode that was supplied to the initial invocation.Returns theQueryBuilderFactoryservice.perform(Mode<E> mode, PersistTask<A, T> task, Optional<A> arg) Performs the given command with the given mode.<A,T> Optional <T> perform(PersistTask<A, T> task) Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them.<A,T> Optional <T> perform(PersistTask<A, T> task, A arg) Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them.<A,T> Optional <T> perform(PersistTask<A, T> task, Optional<A> arg) Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them.Creates a copy of thisCommandContextbut using a differentContext.
-
Method Details
-
getMode
Mode<?> getMode()Returns the mode that was supplied to the initial invocation. -
getContext
Context getContext()Returns the current persist context in use. -
getContextManager
ContextManager getContextManager() -
getPersistenceService
PersistenceService getPersistenceService() -
getQueryBuilderFactory
QueryBuilderFactory getQueryBuilderFactory()Returns theQueryBuilderFactoryservice. -
perform
Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them. This can be used to execute nested commands.- Throws:
Exception
-
perform
Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them. This can be used to execute nested commands.- Throws:
Exception
-
perform
Performs the given command with the same mode as supplied to the parent invocation without wrappingPersistExceptions, but instead propagating them. This can be used to execute nested commands. The argument `Optional.empty()` is passed to the given task.- Throws:
Exception
-
perform
<A, T, E extends Exception> Optional<T> perform(Mode<E> mode, PersistTask<A, T> task, Optional<A> arg) throws EPerforms the given command with the given mode. That is the same asCommandExecutor.perform(Mode, PersistTask, Object).- Type Parameters:
A- type of input to the taskT- result type of the taskE- exception type- Throws:
E
-
using
Creates a copy of thisCommandContextbut using a differentContext. This method is useful if a nested task should be executed with a different context.
-