Hessian2StreamingInput in = _in;
if (in == null)
return false;
Hessian2Input hIn = null;
try {
hIn = in.startPacket();
} catch (IOException e) {
log.fine(this + " exception while reading HMTP packet\n " + e);
log.log(Level.FINER, e.toString(), e);
}
if (hIn == null) {
close();
return false;
}
int type = hIn.readInt();
String to = hIn.readString();
String from = hIn.readString();
switch (HmtpPacketType.TYPES[type]) {
case MESSAGE:
{
Serializable value = (Serializable) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(this + " message " + value
+ " {to:" + to + ", from:" + from + "}");
}
actorStream.message(to, from, value);
break;
}
case MESSAGE_ERROR:
{
Serializable value = (Serializable) hIn.readObject();
ActorError error = (ActorError) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(this + " messageError " + error + " " + value
+ " {to:" + to + ", from:" + from + "}");
}
actorStream.messageError(to, from, value, error);
break;
}
case QUERY_GET:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(this + " queryGet " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");
}
actorStream.queryGet(id, to, from, value);
break;
}
case QUERY_SET:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(this + " querySet " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");
}
actorStream.querySet(id, to, from, value);
break;
}
case QUERY_RESULT:
{
long id = hIn.readLong();
Serializable value = (Serializable) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(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();
ActorError error = (ActorError) hIn.readObject();
in.endPacket();
if (log.isLoggable(Level.FINER)) {
log.finer(this + " queryError " + error + " " + value
+ " {id:" + id + ", to:" + to + ", from:" + from + "}");