|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventhandling.EventTemplate
public class EventTemplate
Template class that dispatches Events to an EventBus
, taking active
UnitOfWork into account. When a UnitOfWork is active, the template will ensure correct ordering with any other
events published during the course of that UnitOfWork. If no unit of work is active, the Event is published
immediately to the Event Bus.
CorrelationDataHolder
Constructor Summary | |
---|---|
EventTemplate(EventBus eventBus)
Initialize the template to publish Events through the given eventBus . |
|
EventTemplate(EventBus eventBus,
Map<String,?> additionalMetaData)
Initialize the template to publish Events through the given eventBus . |
Method Summary | |
---|---|
void |
publishEvent(Object payload)
Publishes an event with given payload on the configured Event Bus. |
void |
publishEvent(Object payload,
Map<String,?> metaData)
Publishes an event with given payload on the configured Event Bus, with given metaData
attached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventTemplate(EventBus eventBus)
eventBus
.
eventBus
- The EventBus to publish Event Messages on.public EventTemplate(EventBus eventBus, Map<String,?> additionalMetaData)
eventBus
. The given
additionalMetaData
is attached to all events published through this instance.
eventBus
- The EventBus to publish Event Messages on.additionalMetaData
- The meta data to add to messages sentMethod Detail |
---|
public void publishEvent(Object payload)
payload
on the configured Event Bus.
This method takes into account that a Unit of Work may be active, using that Unit of Work to ensure
correct publication of the event.
payload
- The payload of the event to publishpublic void publishEvent(Object payload, Map<String,?> metaData)
payload
on the configured Event Bus, with given metaData
attached. If meta data is also configured on this template, the given metaData
will override any
existing entries under the same key.
This method takes into account that a Unit of Work may be active, using that Unit of Work to ensure
correct publication of the event.
payload
- The payload of the event to publishmetaData
- Additional meta data to attach to the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |