Package org.nuxeo.ecm.core.event.stream
Class DomainEventProducerListener
- java.lang.Object
-
- org.nuxeo.ecm.core.event.stream.DomainEventProducerListener
-
- All Implemented Interfaces:
javax.transaction.Synchronization
,EventListener
public class DomainEventProducerListener extends Object implements EventListener, javax.transaction.Synchronization
Dispatches core events to domain event producers.- Since:
- 11.4
-
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<Boolean>
isEnlisted
protected static ThreadLocal<List<DomainEventProducer>>
producers
-
Constructor Summary
Constructors Constructor Description DomainEventProducerListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCompletion(int status)
void
beforeCompletion()
protected void
cleanDomainEventProducers()
void
handleEvent(Event event)
Handle the given event.protected void
initDomainEventProducers()
protected void
produceDomainEvents()
protected boolean
registerSynchronization(javax.transaction.Synchronization sync)
-
-
-
Field Detail
-
isEnlisted
protected static final ThreadLocal<Boolean> isEnlisted
-
producers
protected static final ThreadLocal<List<DomainEventProducer>> producers
-
-
Method Detail
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
initDomainEventProducers
protected void initDomainEventProducers()
-
cleanDomainEventProducers
protected void cleanDomainEventProducers()
-
beforeCompletion
public void beforeCompletion()
- Specified by:
beforeCompletion
in interfacejavax.transaction.Synchronization
-
afterCompletion
public void afterCompletion(int status)
- Specified by:
afterCompletion
in interfacejavax.transaction.Synchronization
-
produceDomainEvents
protected void produceDomainEvents()
-
registerSynchronization
protected boolean registerSynchronization(javax.transaction.Synchronization sync) throws javax.transaction.RollbackException
- Throws:
javax.transaction.RollbackException
-
-