Constructor and Description |
---|
SimpleEventBus() |
Modifier and Type | Method and Description |
---|---|
void |
publishSyncEvent(EventPublisher publisher,
Event event)
Publish the specified event synchronously
|
void |
registerConsumer(EventConsumer consumer,
String publisherName)
Register the consumer for the specified publisher - this consumer will receive all events
from the publisher
|
void |
registerConsumer(EventConsumer consumer,
String publisherName,
String... eventTypes)
Register the consumer for the specified publisher - this consumer will only receive the
specified events from the publisher
|
void |
registerPublisher(EventPublisher publisher,
String... eventTypes)
Register a publisher - only registered publishers can publish events
|
void |
unregisterConsumer(EventConsumer consumer)
Unregister the consumer from all publishers
|
void |
unregisterConsumer(EventConsumer consumer,
String publisherName)
Unregister the consumer from the specified publisher
|
void |
unregisterPublisher(EventPublisher publisher)
Unregister the publisher
|
public void registerPublisher(EventPublisher publisher, String... eventTypes)
EventBus
registerPublisher
in interface EventBus
publisher
- the publishereventTypes
- the full set of event types the publisher can publishpublic void unregisterPublisher(EventPublisher publisher)
EventBus
unregisterPublisher
in interface EventBus
publisher
- the publisherpublic void registerConsumer(EventConsumer consumer, String publisherName)
EventBus
registerConsumer
in interface EventBus
consumer
- the consumer of eventspublisherName
- the name of the publisherpublic void registerConsumer(EventConsumer consumer, String publisherName, String... eventTypes)
EventBus
registerConsumer
in interface EventBus
consumer
- the consumer of eventspublisherName
- the name of the publishereventTypes
- the event typespublic void unregisterConsumer(EventConsumer consumer)
EventBus
unregisterConsumer
in interface EventBus
consumer
- the consumer of eventspublic void unregisterConsumer(EventConsumer consumer, String publisherName)
EventBus
unregisterConsumer
in interface EventBus
consumer
- the consumer of eventspublisherName
- the name of the publisherpublic void publishSyncEvent(EventPublisher publisher, Event event)
EventBus
publishSyncEvent
in interface EventBus
publisher
- the publisherevent
- the event