@Singleton
public class EventPublisher
extends java.lang.Object
| 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 |
cleanUp() |
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)
eventType - The event typeconfiguration - The configuration used when publishing and eventpublic void publishEvent(@Observes
java.lang.Object event)
event - The event to publishjavax.enterprise.event.ObserverException - if the event could not be delivered to RabbitMQ@PreDestroy public void cleanUp()