throws IOException
{
if (actorStream == null)
throw new IllegalStateException("HmtpReader.readPacket requires a valid ActorStream for callbacks");
Hessian2Input hIn = _hIn;
hIn.init(is);
int type = hIn.readInt();
String to = readAddress(hIn);
String from = readAddress(hIn);
switch (HmtpPacketType.TYPES[type]) {
case MESSAGE:
{
Serializable value = (Serializable) hIn.readObject();
if (log.isLoggable(Level.FINEST)) {
log.finest(this + " message " + value
+ " {to:" + to + ", from:" + from + "}");
}
actorStream.message(to, from, value);
break;
}
case MESSAGE_ERROR:
{
Serializable value = (Serializable) hIn.readObject();
BamError error = (BamError) hIn.readObject();
if (log.isLoggable(Level.FINEST)) {
log.finest(this + " messageError " + error + " " + value
+ " {to:" + to + ", from:" + from + "}");
}
actorStream.messageError(to, from, value, error);
break;
}
case QUERY:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
if (log.isLoggable(Level.FINEST)) {
log.finest(this + " query " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");
}
actorStream.query(id, to, from, value);
break;
}
case QUERY_RESULT:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
if (log.isLoggable(Level.FINEST)) {
log.finest(this + " queryResult " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");
}
actorStream.queryResult(id, to, from, value);
break;
}
case QUERY_ERROR:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
BamError error = (BamError) hIn.readObject();
if (log.isLoggable(Level.FINEST)) {
log.finest(this + " queryError " + error + " " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");
}