public enum TransactionPhase extends Enum<TransactionPhase>
TransactionalEventListener.phase()
,
TransactionalApplicationListener.getTransactionPhase()
,
TransactionalApplicationListener.forPayload(TransactionPhase, Consumer)
Enum Constant and Description |
---|
AFTER_COMMIT
Handle the event after the commit has completed successfully.
|
AFTER_COMPLETION
Handle the event after the transaction has completed.
|
AFTER_ROLLBACK
Handle the event if the transaction has rolled back.
|
BEFORE_COMMIT
Handle the event before transaction commit.
|
Modifier and Type | Method and Description |
---|---|
static TransactionPhase |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TransactionPhase[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TransactionPhase BEFORE_COMMIT
public static final TransactionPhase AFTER_COMMIT
Note: This is a specialization of AFTER_COMPLETION
and therefore
executes in the same sequence of events as AFTER_COMPLETION
(and not in TransactionSynchronization.afterCommit()
).
Interactions with the underlying transactional resource will not be
committed in this phase. See
TransactionSynchronization.afterCompletion(int)
for details.
public static final TransactionPhase AFTER_ROLLBACK
Note: This is a specialization of AFTER_COMPLETION
and therefore
executes in the same sequence of events as AFTER_COMPLETION
.
Interactions with the underlying transactional resource will not be
committed in this phase. See
TransactionSynchronization.afterCompletion(int)
for details.
public static final TransactionPhase AFTER_COMPLETION
For more fine-grained events, use AFTER_COMMIT
or
AFTER_ROLLBACK
to intercept transaction commit
or rollback, respectively.
Interactions with the underlying transactional resource will not be
committed in this phase. See
TransactionSynchronization.afterCompletion(int)
for details.
public static TransactionPhase[] values()
for (TransactionPhase c : TransactionPhase.values()) System.out.println(c);
public static TransactionPhase valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null