net.user1.union.core.event
Class RemoteRoomEvent

java.lang.Object
  extended by net.user1.union.core.event.BaseEvent
      extended by net.user1.union.core.event.RemoteRoomEvent
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Event, RemoteEvent

public class RemoteRoomEvent
extends BaseEvent
implements RemoteEvent, java.io.Externalizable

RemoteRoomEvent is a simple data class used to pass information from a room to registered event-listeners when a remote room event occurs. The RemoteRoomEvent class also defines constants representing the available room events. To register for a remote room event, use the Room class's addRemoteEventListener() method.

See Also:
Serialized Form

Field Summary
static java.lang.String ADD_SLAVE_ROOM
          Dispatched by a room when a slave room has been created on another node.
static java.lang.String REMOVE_SLAVE_ROOM
          Dispatched by a room when a slave room has been removed on another node.
 
Fields inherited from class net.user1.union.core.event.BaseEvent
m_eventProperties
 
Constructor Summary
RemoteRoomEvent()
           
RemoteRoomEvent(java.lang.String nodeID, java.lang.String roomID)
          Constructor.
RemoteRoomEvent(java.lang.String nodeID, java.lang.String roomID, java.util.Map<java.lang.String,java.lang.Object> props)
           
 
Method Summary
 java.lang.String getNodeID()
          Returns the ID of the node where the event originated.
 java.lang.String getRoomID()
          Returns the ID of the room involved in the event.
 void readExternal(java.io.ObjectInput in)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class net.user1.union.core.event.BaseEvent
getProperty, isCanceled, preventDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.user1.union.core.event.Event
getProperty, isCanceled, preventDefault
 

Field Detail

ADD_SLAVE_ROOM

public static final java.lang.String ADD_SLAVE_ROOM
Dispatched by a room when a slave room has been created on another node. Modules of the room should listen for this event if they need to synchronize slave rooms or need to keep information keyed to slaves. For example, a game may need to update each new slave with the current state of the game or it may need to keep track of the number of players on teams across the cluster and must create a new map entry for each new slave.

See Also:
Constant Field Values

REMOVE_SLAVE_ROOM

public static final java.lang.String REMOVE_SLAVE_ROOM
Dispatched by a room when a slave room has been removed on another node. This would generally mean the node of the slave room has gone down. Modules of the room should listen for this event if they are keeping information updated from each slave and need to know when a slave room no longer exists.

See Also:
Constant Field Values
Constructor Detail

RemoteRoomEvent

public RemoteRoomEvent()

RemoteRoomEvent

public RemoteRoomEvent(java.lang.String nodeID,
                       java.lang.String roomID)
Constructor.


RemoteRoomEvent

public RemoteRoomEvent(java.lang.String nodeID,
                       java.lang.String roomID,
                       java.util.Map<java.lang.String,java.lang.Object> props)
Method Detail

getNodeID

public java.lang.String getNodeID()
Returns the ID of the node where the event originated.

Returns:
the ID of the node where the event originated

getRoomID

public java.lang.String getRoomID()
Returns the ID of the room involved in the event.

Returns:
the ID of the room involved in the event

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException


Copyright USER1 Subsystems Corporation - Tue Jan 28 2014, 05:05 PM -0500