Methods Summary |
---|
protected abstract BasicMessage | buildMessage(java.lang.String msgId)
|
public BasicMessage | readMsg()
BasicMessage msg;
String token;
DataInputStream din = new DataInputStream(msgIn);
// Get message ID and build corresponding BasicMessage
token = din.readUTF();
msg = buildMessage(token);
// Tell message to read its args
if (msg != null && msg.readArgs(msgIn))
return msg;
else
return null;
|
public void | run()
try {
while (true) {
BasicMessage msg = readMsg();
if (msg != null)
msg.Do();
}
}
// Treat an IOException as a termination of the message
// exchange, and let this message-processing thread die.
catch (IOException e) {}
|
public void | sendMsg(BasicMessage msg)
boolean success = true;
DataOutputStream dout = new DataOutputStream(msgOut);
// Send message ID
dout.writeUTF(msg.messageID());
// Tell message to send its arguments
msg.writeArgs(msgOut);
|
protected void | setStreams(java.io.InputStream in, java.io.OutputStream out)
msgIn = in;
msgOut = out;
|