Class ContextMode
java.lang.Object
ch.tocco.nice2.persist.core.spi.exec.AbstractModeWrapper
ch.tocco.nice2.persist.core.impl.hibernate.exec.ContextMode
- All Implemented Interfaces:
ModeWrapper
ModeWrapper
that executes the wrapped task in a new context.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Mode.Key
<?> getKey()
Results inPriority.NORMAL
: It must higher than the TxMode, as the new context must be created before the transaction.<A,
T> PersistTask <A, T> wrap
(PersistTask<A, T> task, Mode<?> mode) Returns a task conforming to the given mode.Methods inherited from class ch.tocco.nice2.persist.core.spi.exec.AbstractModeWrapper
getPriority
-
Constructor Details
-
ContextMode
-
-
Method Details
-
wrap
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 givenmode
, a new task is returned wrapping the given task with additional behaviour. If the condition does not hold, thetask
argument is returned. -
getKey
Results inPriority.NORMAL
: It must higher than the TxMode, as the new context must be created before the transaction.- Overrides:
getKey
in classAbstractModeWrapper
-