Package com.atlassian.jira.event.commit
Class OnCommitEventManagerImpl
java.lang.Object
com.atlassian.jira.event.commit.OnCommitEventManagerImpl
- All Implemented Interfaces:
OnCommitEventManager
@ParametersAreNonnullByDefault
public class OnCommitEventManagerImpl
extends Object
implements OnCommitEventManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatchAsOnCommitEvent
(Supplier<Object> eventSupplier) Will wrap the provided event into a defaultOnCommitEvent
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.
-
Constructor Details
-
OnCommitEventManagerImpl
-
-
Method Details
-
dispatchAsOnCommitEvent
Description copied from interface:OnCommitEventManager
Will wrap the provided event into a defaultOnCommitEvent
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
, useIssueEventManager
- Specified by:
dispatchAsOnCommitEvent
in interfaceOnCommitEventManager
- Parameters:
eventSupplier
- The supplier of the event object to wrap into anOnCommitEvent
event
-
dispatchOnCommitEvent
Description copied from interface:OnCommitEventManager
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 theOnCommitEvent.getOnCommitEventDataReloadStatus()
can be set toOnCommitEvent.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
, useIssueEventManager
- Specified by:
dispatchOnCommitEvent
in interfaceOnCommitEventManager
- Type Parameters:
T
- The wrapped type of the event- Parameters:
onCommitEventSupplier
- The supplier of theOnCommitEvent
event to send
-