@Singleton
public class EventPublisher
extends java.lang.Object
Publishes events to exchanges of a broker.
| Constructor and Description |
|---|
EventPublisher(ConnectionProducer connectionProducer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEvent(java.lang.Class<?> eventType,
net.reini.rabbitmq.cdi.PublisherConfiguration configuration)
Adds events of the given type to the CDI events to which the event publisher listens in order
to publish them.
|
void |
publishEvent(java.lang.Object event)
Observes CDI events for remote events and publishes those events if their event type was added
before.
|
@Inject public EventPublisher(ConnectionProducer connectionProducer)
public void addEvent(java.lang.Class<?> eventType,
net.reini.rabbitmq.cdi.PublisherConfiguration configuration)
Adds events of the given type to the CDI events to which the event publisher listens in order to publish them. The publisher configuration is used to decide where to and how to publish messages.
T - The event typeeventType - The event typeconfiguration - The configuration used when publishing and eventpublic void publishEvent(@Observes
java.lang.Object event)
Observes CDI events for remote events and publishes those events if their event type was added before.
event - The event to publish