Interface ModeWrapper

All Known Implementing Classes:
AbstractModeWrapper, BusinessUnitMode, ContextMode, ExecutionContextMode, L10NMode, PredefinedAnswersMode, PrivilegedMode, RunAsMode, SilentHistoryMode, SubmittedMode, TxMode

public interface ModeWrapper
Allows to wrap PersistTasks for implementing modes.
  • Method Summary

    Modifier and Type
    Method
    Description
    getPriority(Mode<?> mode)
    This method returns the priority for this wrapper.
    <A, T> PersistTask<A,T>
    wrap(PersistTask<A,T> task, Mode<?> mode)
    Returns a task conforming to the given mode.
  • Method Details

    • wrap

      <A, T> PersistTask<A,T> wrap(PersistTask<A,T> task, Mode<?> mode)
      Returns a task conforming to the given mode. Gives the opportunity to wrap the given task (or create a complete new one) before executing it.

      The usual use case is this: If some condition holds inside the given mode, a new task is returned wrapping the given task with additional behaviour. If the condition does not hold, the task argument is returned.

    • getPriority

      Priority getPriority(Mode<?> mode)
      This method returns the priority for this wrapper. Please see Priority class documentation.