Interface RemoteEventProducer
- All Superinterfaces:
EventProducer
A RemoteEventProducer can dispatch events that are re-dispatched by the equivalent objects across the cluster.
If a ClusterRole.MASTER room dispatches a remote event it is re-dispatched by each ClusterRole.SLAVE room
across the cluster. If a ClusterRole.SLAVE room dispatches a remote event it is re-dispatched by the ClusterRole.MASTER
room.
If the server dispatches a remote event it is re-dispatched by each server on the cluster.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRemoteEventListener
(String event, Object callbackObject, String callbackMethod) Adds an event listener to this RemoteEventProducer.void
dispatchRemoteEvent
(String eventName, RemoteEvent evt) Has the event producer dispatch a remote event.void
dispatchRemoteEvent
(String eventName, RemoteEvent evt, String nodeID) Has the event producer dispatch a remote event to the specified node only.Map
<String, Class<? extends RemoteEvent>> Returns a Map of declared remote events dispatched by the RemoteEventProducer keyed by event name and mapped to the remote event class that is dispatched.void
removeRemoteEventListener
(String event, Object callbackObject, String callbackMethod) Deregisters an event listener for an event from this RemoteEventProducer.Methods inherited from interface net.user1.union.core.event.EventProducer
addEventListener, dispatchEvent, getEventClassMap, removeEventListener
-
Method Details
-
addRemoteEventListener
Adds an event listener to this RemoteEventProducer.- Parameters:
event
- - the event the listener is interested incallbackObject
- - the object which will receive the event notificationcallbackMethod
- - the method that will be invoked on callbackObject for the event notification
-
removeRemoteEventListener
Deregisters an event listener for an event from this RemoteEventProducer.- Parameters:
event
- - the event to longer be listened forcallbackObject
- - the object which was receiving the event notificationcallbackMethod
- - the method that was invoked on callbackObject for the event notification
-
getRemoteEventClassMap
Map<String,Class<? extends RemoteEvent>> getRemoteEventClassMap()Returns a Map of declared remote events dispatched by the RemoteEventProducer keyed by event name and mapped to the remote event class that is dispatched.- Returns:
- a Map of declared events dispatched by the EventProducer
-
dispatchRemoteEvent
Has the event producer dispatch a remote event.- Parameters:
eventName
- - the name of the event to dispatchevt
- - the remote event Object for the event
-
dispatchRemoteEvent
Has the event producer dispatch a remote event to the specified node only.- Parameters:
eventName
- - the name of the event to dispatchevt
- - the event Object for the eventnodeID
- - the nodeID to which the event will be dispatched
-