|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.networking.Connection
net.sf.freecol.server.networking.DummyConnection
public final class DummyConnection
A dummy connection, used for AI players.
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
LICENSE
|
static java.lang.String |
REVISION
|
| Constructor Summary | |
|---|---|
DummyConnection(java.lang.String name,
MessageHandler incomingMessageHandler)
Sets up a dummy connection using the specified MessageHandlers. |
|
| Method Summary | |
|---|---|
org.w3c.dom.Element |
ask(org.w3c.dom.Element element)
Sends a message to the other peer and returns the reply. |
void |
close()
Closes this connection. |
DummyConnection |
getOtherConnection()
Gets the DummyConnection this object is connected to. |
void |
send(org.w3c.dom.Element element)
Sends the given message over this Connection. |
void |
sendAndWait(org.w3c.dom.Element element)
Sends the given message over this Connection and waits for
confirmation of receiveval before returning. |
void |
setOutgoingMessageHandler(DummyConnection c)
Sets the outgoing MessageHandler for this Connection. |
java.lang.String |
toString()
Return a human-readable string with the dummy connection name. |
| Methods inherited from class net.sf.freecol.common.networking.Connection |
|---|
ask, endTransmission, getMessageHandler, getReply, getSocket, handleAndSendReply, reallyClose, send, setMessageHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
| Constructor Detail |
|---|
public DummyConnection(java.lang.String name,
MessageHandler incomingMessageHandler)
MessageHandlers.
name - The name that identifies the connection.incomingMessageHandler - The MessageHandler to call for each message
received.| Method Detail |
|---|
public void close()
throws java.io.IOException
close in class Connectionjava.io.IOException - Will not be thrown by a DummyConnection,
but added because of the superclass' specification.
public void send(org.w3c.dom.Element element)
throws java.io.IOException
send in class Connectionelement - The element (root element in a DOM-parsed XML tree) that
holds all the information
java.io.IOException - If an error occur while sending the message.sendAndWait(Element),
ask(Element)
public org.w3c.dom.Element ask(org.w3c.dom.Element element)
throws java.io.IOException
ask in class Connectionelement - The question for the other peer.
java.io.IOException - If an error occur while sending the message.send(org.w3c.dom.Element),
sendAndWait(org.w3c.dom.Element)
public void sendAndWait(org.w3c.dom.Element element)
throws java.io.IOException
Connection and waits for
confirmation of receiveval before returning.
sendAndWait in class Connectionelement - The element (root element in a DOM-parsed XML tree) that
holds all the information
java.io.IOException - If an error occur while sending the message.send(Element),
ask(Element)public void setOutgoingMessageHandler(DummyConnection c)
c - The connectio to get the messagehandler from.public DummyConnection getOtherConnection()
DummyConnection this object is connected to.
DummyConnection .public java.lang.String toString()
toString in class Connection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||