Class CollectingAfterCommitListener
java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingAfterCommitListener
- All Implemented Interfaces:
ContextListener
,EntityListener
,CommitListener
,EventListener
- Direct Known Subclasses:
AbsenceReportCreateEntityListener
,AbsenceReportEntityListener
,CalculateContingentsAfterCommitListener
,CreateConflictEntityListener
,EntityFolderTemplateAfterCommitListener
,EventRegistrationCreationAfterCommitListener
,ExamAverageAfterCommitListener
,FulltextIndexEntityListener
,InputStatisticsAfterCommitListener
,MinimalPresenceCreateEntityListener
,NewsletterReadDateListener
,NotificationAfterCommitListener
,OpenIdRegistrationListener
,RabbitMqAfterCommitListener
,ReferenceCodeCreateEntityListener
,ResourceSearchTextTikaEntityListener
,ScriptScheduler
,SendInvitationMailEntityListener
,TodoRuleListener
,TopicSubscriptionMailDispatcher
public abstract class CollectingAfterCommitListener
extends Object
implements EntityListener, CommitListener, ContextListener
-
Constructor Summary
ConstructorDescriptionCollectingAfterCommitListener
(Context context, CommandExecutor commandExecutor) Deprecated.use constructor without context argument.CollectingAfterCommitListener
(CommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
afterCommit
(Context context) Notifies about the point where the transaction has been fully committed.final void
Notifies about the point where the transaction is about to be committed.final void
contextDestroying
(ContextEvent event) customizeMode
(Mode<E> mode) override this method to customize the mode for task to be executed after the commitfinal void
entityCreated
(EntityEvent event) Fired for newly created entities after the transaction committed successfully.final void
entityDeleted
(EntityEvent event) Fired for deleted entities after the transaction committed successfully.final void
entityUpdated
(EntityEvent event) Fired for updated entities after the transaction committed successfully.protected abstract AfterCommitTask
protected void
void
setFutureCollector
(FutureCollector futureCollector) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.util.CommitListener
afterFlush, priority
Methods inherited from interface ch.tocco.nice2.persist.core.api.ContextListener
transactionStarted
-
Constructor Details
-
CollectingAfterCommitListener
-
CollectingAfterCommitListener
Deprecated.use constructor without context argument.
-
-
Method Details
-
setFutureCollector
- Parameters:
futureCollector
- The future collector to use. Choose eitherFutureCollector.discarding()
(default) orFutureCollector.collecting()
. Please don't collect futures in production environment. However, collecting futures in unit tests might be useful since it allows to await the completion of those.
-
beforeCommit
Description copied from interface:CommitListener
Notifies about the point where the transaction is about to be committed.
This allows further modification of involved entities.
- Specified by:
beforeCommit
in interfaceCommitListener
- Parameters:
tx
- the transaction in question
-
afterCommit
Description copied from interface:CommitListener
Notifies about the point where the transaction has been fully committed.
This allows post processing of the entities involved in the previous commit.
- Specified by:
afterCommit
in interfaceCommitListener
-
handleAfterCommit
protected void handleAfterCommit() -
customizeMode
override this method to customize the mode for task to be executed after the commit- Parameters:
mode
- mode with default settings for CollectingAfterCommitListeners, make changes
-
getAfterCommitTask
-
entityCreated
Description copied from interface:EntityListener
Fired for newly created entities after the transaction committed successfully.- Specified by:
entityCreated
in interfaceEntityListener
-
entityUpdated
Description copied from interface:EntityListener
Fired for updated entities after the transaction committed successfully.- Specified by:
entityUpdated
in interfaceEntityListener
-
entityDeleted
Description copied from interface:EntityListener
Fired for deleted entities after the transaction committed successfully.- Specified by:
entityDeleted
in interfaceEntityListener
-
contextDestroying
- Specified by:
contextDestroying
in interfaceContextListener
-