fr.lifl.genca.centralised
Class CentralisedCommunicator

java.lang.Object
  extended byfr.lifl.genca.centralised.CentralisedCommunicator
All Implemented Interfaces:
Communicator

public class CentralisedCommunicator
extends java.lang.Object
implements Communicator

This class provides a communicator for a centralised application, where the communicator sends a message when it is its turn.

Author:
Marie-Hélène Verrons

Field Summary
protected  java.lang.String myName
           
protected  AgentServer myServer
           
protected  java.util.Vector outBox
           
 
Constructor Summary
CentralisedCommunicator(AgentServer as, java.lang.String n)
           
 
Method Summary
 void sendOneMessage()
           
 void sendToAgent(java.lang.Object to, ServerMessage msg)
          to send a message to one participant (synchronous).
 void sendToServer(ServerMessage msg)
          for an agent to send a message to the names server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myServer

protected AgentServer myServer

outBox

protected java.util.Vector outBox

myName

protected java.lang.String myName
Constructor Detail

CentralisedCommunicator

public CentralisedCommunicator(AgentServer as,
                               java.lang.String n)
Method Detail

sendToServer

public void sendToServer(ServerMessage msg)
Description copied from interface: Communicator
for an agent to send a message to the names server

Specified by:
sendToServer in interface Communicator
Parameters:
msg - the message to send

sendOneMessage

public void sendOneMessage()

sendToAgent

public void sendToAgent(java.lang.Object to,
                        ServerMessage msg)
to send a message to one participant (synchronous). Must call the method receiveMessage of the Negotiator of the agent.

Specified by:
sendToAgent in interface Communicator
Parameters:
to - the user/agent address
msg - the content of the mesage