Class PrivilegedCommitContribution
java.lang.Object
ch.tocco.nice2.persist.security.impl.PrivilegedCommitContribution
- All Implemented Interfaces:
CommitInvokerContribution
@Component
public class PrivilegedCommitContribution
extends Object
implements CommitInvokerContribution
This service makes sure that all transaction commits and rollbacks are executed in
privileged mode. This is required e.g. for validating the entities before they're
committed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis invoker is used when committing a transaction.
-
Constructor Details
-
PrivilegedCommitContribution
-
-
Method Details
-
invokerForCommit
- Specified by:
invokerForCommit
in interfaceCommitInvokerContribution
-
nestedInvokerForCommitListener
This invoker is used when committing a transaction. If the transaction is at that point privileged, we want the following commit listeners to run in privileged mode as well. Otherwise, we need to explicitly use a secured invoker, since the rest of the transaction logic is executed in privileged mode either way.- Specified by:
nestedInvokerForCommitListener
in interfaceCommitInvokerContribution
- Returns:
- Either an empty invoker if currently privileged, secured invoker otherwise
-