Interface RemoteEventProducer

All Superinterfaces:
EventProducer
All Known Subinterfaces:
Room, Server

public interface RemoteEventProducer extends 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 Details

    • addRemoteEventListener

      void addRemoteEventListener(String event, Object callbackObject, String callbackMethod)
      Adds an event listener to this RemoteEventProducer.
      Parameters:
      event - - the event the listener is interested in
      callbackObject - - the object which will receive the event notification
      callbackMethod - - the method that will be invoked on callbackObject for the event notification
    • removeRemoteEventListener

      void removeRemoteEventListener(String event, Object callbackObject, String callbackMethod)
      Deregisters an event listener for an event from this RemoteEventProducer.
      Parameters:
      event - - the event to longer be listened for
      callbackObject - - the object which was receiving the event notification
      callbackMethod - - 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

      void dispatchRemoteEvent(String eventName, RemoteEvent evt)
      Has the event producer dispatch a remote event.
      Parameters:
      eventName - - the name of the event to dispatch
      evt - - the remote event Object for the event
    • dispatchRemoteEvent

      void dispatchRemoteEvent(String eventName, RemoteEvent evt, String nodeID)
      Has the event producer dispatch a remote event to the specified node only.
      Parameters:
      eventName - - the name of the event to dispatch
      evt - - the event Object for the event
      nodeID - - the nodeID to which the event will be dispatched