|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
dk.brics.bisim.controller.MessagePasserImpl
public class MessagePasserImpl
Implementation of the MessagePasser.
MessagePasser
,
Serialized FormField Summary | |
---|---|
private java.util.HashMap<java.lang.Integer,GameController> |
gameControllers
Registrered game controllers. |
private static long |
serialVersionUID
|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
MessagePasserImpl()
Constructs a message passer with a map of game controllers, identified by their client server role. |
Method Summary | |
---|---|
void |
quit(int clientServerRole)
Notifies listeners that a player wants to quit, and unregisters that player. |
void |
registerGameController(GameController c,
int clientServerRole)
Registers a local game controller, such that it may receive messages. |
void |
sendMessage(int messageNumber,
java.lang.String message)
Used for sending move messages between game controllers. |
void |
talk(int clientServerRole,
java.lang.String message)
Used for sending chat messages to the other player. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private java.util.HashMap<java.lang.Integer,GameController> gameControllers
Constructor Detail |
---|
public MessagePasserImpl() throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
public void registerGameController(GameController c, int clientServerRole) throws java.rmi.RemoteException
MessagePasser
registerGameController
in interface MessagePasser
c
- A game controllerclientServerRole
- The role of the game controller
java.rmi.RemoteException
public void sendMessage(int messageNumber, java.lang.String message) throws java.rmi.RemoteException
MessagePasser
sendMessage
in interface MessagePasser
messageNumber
- A message numbermessage
- An encoded message
java.rmi.RemoteException
Protocol
public void quit(int clientServerRole) throws java.rmi.RemoteException
MessagePasser
quit
in interface MessagePasser
java.rmi.RemoteException
public void talk(int clientServerRole, java.lang.String message) throws java.rmi.RemoteException
MessagePasser
talk
in interface MessagePasser
clientServerRole
- The role of the player sending a message, used to identify
the othermessage
- The message
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |