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 Details

    • CollectingAfterCommitListener

      public CollectingAfterCommitListener(CommandExecutor commandExecutor)
    • CollectingAfterCommitListener

      @Deprecated public CollectingAfterCommitListener(Context context, CommandExecutor commandExecutor)
      Deprecated.
      use constructor without context argument.
  • Method Details

    • setFutureCollector

      public void setFutureCollector(FutureCollector futureCollector)
      Parameters:
      futureCollector - The future collector to use. Choose either FutureCollector.discarding() (default) or FutureCollector.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

      public final void beforeCommit(Transaction tx)
      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 interface CommitListener
      Parameters:
      tx - the transaction in question
    • afterCommit

      public final void afterCommit(Context context)
      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 interface CommitListener
    • handleAfterCommit

      protected void handleAfterCommit()
    • customizeMode

      protected <E extends Exception> Mode<E> customizeMode(Mode<E> mode)
      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

      protected abstract AfterCommitTask getAfterCommitTask()
    • entityCreated

      public final void entityCreated(EntityEvent event)
      Description copied from interface: EntityListener
      Fired for newly created entities after the transaction committed successfully.
      Specified by:
      entityCreated in interface EntityListener
    • entityUpdated

      public final void entityUpdated(EntityEvent event)
      Description copied from interface: EntityListener
      Fired for updated entities after the transaction committed successfully.
      Specified by:
      entityUpdated in interface EntityListener
    • entityDeleted

      public final void entityDeleted(EntityEvent event)
      Description copied from interface: EntityListener
      Fired for deleted entities after the transaction committed successfully.
      Specified by:
      entityDeleted in interface EntityListener
    • contextDestroying

      public final void contextDestroying(ContextEvent event)
      Specified by:
      contextDestroying in interface ContextListener