Interface CommandContext


public interface CommandContext
  • 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 the QueryBuilderFactory service.
    • perform

      <A, T> Optional<T> perform(PersistTask<A,T> task, Optional<A> arg) throws Exception
      Performs the given command with the same mode as supplied to the parent invocation without wrapping PersistExceptions, but instead propagating them. This can be used to execute nested commands.
      Throws:
      Exception
    • perform

      <A, T> Optional<T> perform(PersistTask<A,T> task, A arg) throws Exception
      Performs the given command with the same mode as supplied to the parent invocation without wrapping PersistExceptions, but instead propagating them. This can be used to execute nested commands.
      Throws:
      Exception
    • perform

      <A, T> Optional<T> perform(PersistTask<A,T> task) throws Exception
      Performs the given command with the same mode as supplied to the parent invocation without wrapping PersistExceptions, 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 E
      Performs the given command with the given mode. That is the same as CommandExecutor.perform(Mode, PersistTask, Object).
      Type Parameters:
      A - type of input to the task
      T - result type of the task
      E - exception type
      Throws:
      E
    • using

      CommandContext using(Context context)
      Creates a copy of this CommandContext but using a different Context. This method is useful if a nested task should be executed with a different context.