Enum TransactionalEventListener.TransactionPhase
- java.lang.Object
-
- java.lang.Enum<TransactionalEventListener.TransactionPhase>
-
- io.micronaut.transaction.annotation.TransactionalEventListener.TransactionPhase
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TransactionalEventListener.TransactionPhase>
- Enclosing class:
- TransactionalEventListener
public static enum TransactionalEventListener.TransactionPhase extends java.lang.Enum<TransactionalEventListener.TransactionPhase>
The phase at which a transactional event listener applies.- Since:
- 4.2
- Author:
- Stephane Nicoll, Juergen Hoeller, graemerocher
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AFTER_COMMIT
Fire the event after the commit has completed successfully.AFTER_COMPLETION
Fire the event after the transaction has completed.AFTER_ROLLBACK
Fire the event if the transaction has rolled back.BEFORE_COMMIT
Fire the event before transaction commit.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TransactionalEventListener.TransactionPhase
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TransactionalEventListener.TransactionPhase[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BEFORE_COMMIT
public static final TransactionalEventListener.TransactionPhase BEFORE_COMMIT
Fire the event before transaction commit.
-
AFTER_COMMIT
public static final TransactionalEventListener.TransactionPhase AFTER_COMMIT
Fire the event after the commit has completed successfully.Note: This is a specialization of
AFTER_COMPLETION
and therefore executes in the same after-completion sequence of events, (and not inTransactionSynchronization.afterCommit()
).
-
AFTER_ROLLBACK
public static final TransactionalEventListener.TransactionPhase AFTER_ROLLBACK
Fire the event if the transaction has rolled back.Note: This is a specialization of
AFTER_COMPLETION
and therefore executes in the same after-completion sequence of events.
-
AFTER_COMPLETION
public static final TransactionalEventListener.TransactionPhase AFTER_COMPLETION
Fire the event after the transaction has completed.For more fine-grained events, use
AFTER_COMMIT
orAFTER_ROLLBACK
to intercept transaction commit or rollback, respectively.
-
-
Method Detail
-
values
public static TransactionalEventListener.TransactionPhase[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TransactionalEventListener.TransactionPhase c : TransactionalEventListener.TransactionPhase.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TransactionalEventListener.TransactionPhase valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-