@Singleton
public class EventPublisher
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EventPublisher.PublisherConfiguration
A publisher configuration stores all important settings and options used for publishing and
event.
|
| Constructor and Description |
|---|
EventPublisher() |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addEvent(java.lang.Class<T> eventType,
EventPublisher.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.
|
public <T> void addEvent(java.lang.Class<T> eventType,
EventPublisher.PublisherConfiguration configuration)
T - The event typeeventType - The event typeconfiguration - The configuration used when publishing and eventpublic void publishEvent(@Observes
java.lang.Object event)
throws java.io.IOException,
java.util.concurrent.TimeoutException
event - The event to publishjava.io.IOException - if the event failed to be publishedjava.util.concurrent.TimeoutException - if the event failed to be published