Class TransactionAwareEventDispatcher

java.lang.Object
com.atlassian.event.internal.AsynchronousAbleEventDispatcher
com.atlassian.crowd.core.event.TransactionAwareEventDispatcher
All Implemented Interfaces:
com.atlassian.event.spi.EventDispatcher

public class TransactionAwareEventDispatcher extends com.atlassian.event.internal.AsynchronousAbleEventDispatcher
Wraps dispatching each atlassian-events event in a separate hibernate transaction. These are marked as PROPAGATION_REQUIRES_NEW, to get a new synchronisation context, and to work correclty with being invoked when invoked in an afterCommit() call by TransactionAwareEventPublisher. The physical transaction for the calling thread should actually never be active when {dispatch(ListenerInvoker, Object)} is called.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Listeners with this scope will not be automatically run in transaction and will be responsible of transaction management on it's own.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TransactionAwareEventDispatcher(com.atlassian.event.spi.EventExecutorFactory executorFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispatch(com.atlassian.event.spi.ListenerInvoker invoker, Object event)
     

    Methods inherited from class com.atlassian.event.internal.AsynchronousAbleEventDispatcher

    executorFor, getAsynchronousExecutor, getSynchronousExecutor

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DISABLE_TRANSACTION

      public static final String DISABLE_TRANSACTION
      Listeners with this scope will not be automatically run in transaction and will be responsible of transaction management on it's own.
      See Also:
  • Constructor Details

    • TransactionAwareEventDispatcher

      public TransactionAwareEventDispatcher(com.atlassian.event.spi.EventExecutorFactory executorFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
  • Method Details

    • dispatch

      public void dispatch(com.atlassian.event.spi.ListenerInvoker invoker, Object event)
      Specified by:
      dispatch in interface com.atlassian.event.spi.EventDispatcher
      Overrides:
      dispatch in class com.atlassian.event.internal.AsynchronousAbleEventDispatcher