public interface EventBus
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
|
void registerPublisher(EventPublisher publisher, String... eventTypes)
publisher
- the publishereventTypes
- the full set of event types the publisher can publishvoid unregisterPublisher(EventPublisher publisher)
publisher
- the publishervoid registerConsumer(EventConsumer consumer, String publisherName)
consumer
- the consumer of eventspublisherName
- the name of the publishervoid registerConsumer(EventConsumer consumer, String publisherName, String... eventTypes)
consumer
- the consumer of eventspublisherName
- the name of the publishereventTypes
- the event typesvoid unregisterConsumer(EventConsumer consumer)
consumer
- the consumer of eventsvoid unregisterConsumer(EventConsumer consumer, String publisherName)
consumer
- the consumer of eventspublisherName
- the name of the publishervoid publishSyncEvent(EventPublisher publisher, Event event)
publisher
- the publisherevent
- the event