if (inside)
{
new Throwable().printStackTrace();
}
inside = true;
Decoder dec = readBody(message);
Destination replyTo;
try
{
replyTo = message.getJMSReplyTo();
} catch (JMSException e)
{
throw new AgentException(e);
}
byte[] magic = dec.readBytes(3);
if (magic[0] != 'A' || magic[1] != 'M' || magic[2] != '2')
{
throw new AgentException("bad magic: " + new String(magic));
}
short op = dec.readUint8();
long seq = dec.readUint32();
log.debug("Message recieved: " + (char) op);
switch (op)
{
case 'a':
this.handleAgentAttach(seq, replyTo, dec);