@Service(name="payara-event-bus") @RunLevel(value=10) public class EventBus extends Object implements EventListener, MonitoringDataSource
EventListener.Event<T>
Constructor and Description |
---|
EventBus() |
Modifier and Type | Method and Description |
---|---|
boolean |
addMessageReceiver(String topic,
MessageReceiver mr)
Adds a message receiver to listen to message send on the Hazelcast EventBus
|
void |
collect(MonitoringDataCollector rootCollector)
Collects all the data points of this at the current moment.
|
void |
event(EventListener.Event event)
Process a Glassfish/Payara event
|
void |
postConstruct() |
boolean |
publish(String topic,
ClusterMessage message)
Sends out a message to all listeners in the Hazelcast sluster that are
listening to the topic
|
void |
removeMessageReceiver(String topic,
MessageReceiver mr)
Stops a message receiver from listening to messages on the specified topic
|
@PostConstruct public void postConstruct()
public void collect(MonitoringDataCollector rootCollector)
MonitoringDataSource
collect
in interface MonitoringDataSource
rootCollector
- the MonitoringDataCollector
instance to use to collect the data points of this sourcepublic boolean publish(String topic, ClusterMessage message)
topic
- message
- public boolean addMessageReceiver(String topic, MessageReceiver mr)
topic
- The name of the topic to recive messages onmr
- A MessageReciever
to listen for messagespublic void removeMessageReceiver(String topic, MessageReceiver mr)
topic
- The name of the topic that messages have been received onmr
- The MessageReciever
to stop listening for messagespublic void event(EventListener.Event event)
EventListener
event
in interface EventListener
Copyright © 2019. All rights reserved.