Class SubmittedMode

java.lang.Object
ch.tocco.nice2.persist.security.impl.exec.SubmittedMode
All Implemented Interfaces:
ModeWrapper

@Component public class SubmittedMode extends Object implements ModeWrapper
If a task is submitted it is executed on a separate thread. The default behaviour is to execute it under the user of the calling thread.
  • Constructor Details

  • Method Details

    • wrap

      public <A, T> PersistTask<A,T> wrap(PersistTask<A,T> task, Mode<?> mode)
      Description copied from interface: ModeWrapper
      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.

      Specified by:
      wrap in interface ModeWrapper
    • getPriority

      public Priority getPriority(Mode<?> mode)
      Description copied from interface: ModeWrapper
      This method returns the priority for this wrapper. Please see Priority class documentation.
      Specified by:
      getPriority in interface ModeWrapper