Entity Lifecycle Monitor
An implementation of TransactionListener which monitors the transaction flow and triggers the EntityLifecycle.
On a successful Phase, memoizes the ID of the applied message. After a successful transaction commit, passes the memoized IDs to the EntityLifecycle of the entity under transaction, along with the information about the mutations performed under the transaction - an EntityRecordChange.
An instance of this TransactionListener is meant to serve for a single Transaction. When trying to reuse a listener for multiple transactions, an IllegalStateException is thrown.
Parameters
<I>
ID type of the entity under transaction
Functions
Link copied to clipboard
public static EntityLifecycleMonitor<I> newInstance<I>(Repository<I, ? extends Object> repository, I id)
Creates a new instance of
EntityLifecycleMonitor
.Link copied to clipboard
A callback invoked after a successful commit.
Link copied to clipboard
A callback invoked after applying a transaction phase.
Link copied to clipboard
A callback invoked before committing the transaction.
Link copied to clipboard
A callback invoked before applying a transaction phase.
Link copied to clipboard
A callback invoked if the commit has failed due to a Rejection.
A callback invoked if the commit has failed.