Interface OnCommitEventManager

All Known Implementing Classes:
OnCommitEventManagerImpl

@ExperimentalApi @InjectableComponent @ParametersAreNonnullByDefault public interface OnCommitEventManager
Allow to publish OnCommitEvent and OnCommitIssueEventBundle events, that if inside a transaction will not actually be published until the transaction has finished. If not inside a transaction, the events will be published immediately.

NB: If you would like to fire an issue related event, it is recommended to use IssueEventManager.dispatchIssueEventOnCommit(Supplier) or IssueEventManager.dispatchIssueEventBundleOnCommit(Supplier) as these will provide better semantics for the wrapped issue specific events.

Since:
v7.4.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Will wrap the provided event into a default OnCommitEvent object, for publishing.
    <T> void
    dispatchOnCommitEvent(Supplier<OnCommitEvent<T>> onCommitEventSupplier)
    Will publish the event immediately if not inside a transaction, otherwise will be published once the current transactions has finished.
  • Method Details

    • dispatchAsOnCommitEvent

      void dispatchAsOnCommitEvent(Supplier<Object> eventSupplier)
      Will wrap the provided event into a default OnCommitEvent object, for publishing.

      The Supplier will be invoked when the event is about to be published.

      NB: This is intended for non issue related events that would like to ensure they are fired after any transaction has completed. For issue related OnCommitEvent, use IssueEventManager

      Parameters:
      eventSupplier - The supplier of the event object to wrap into an OnCommitEvent event
    • dispatchOnCommitEvent

      <T> void dispatchOnCommitEvent(Supplier<OnCommitEvent<T>> onCommitEventSupplier)
      Will publish the event immediately if not inside a transaction, otherwise will be published once the current transactions has finished.

      The Supplier will be invoked when the event is about to be published, so any data that should be reloaded can be done inside it. Potentially the OnCommitEvent.getOnCommitEventDataReloadStatus() can be set to OnCommitEvent.OnCommitEventDataReloadStatus.RELOADED_ON_COMMIT for the event.

      NB: This is intended for non issue related events that would like to ensure they are fired after any transaction has completed. For issue related OnCommitEvent, use IssueEventManager

      Type Parameters:
      T - The wrapped type of the event
      Parameters:
      onCommitEventSupplier - The supplier of the OnCommitEvent event to send