public abstract class RoutingActor extends Actor implements DispatchTarget
Actor that receives targeted JSON messages over its connection.
This class is abstract, in that its implementation of the MessageHandler interface is
incomplete: it implements the processMessage()
method, but subclasses must implement connectionDied()
method (as well as any JSONMethod methods for whatever specific
object behavior the subclass is intended for).
| Constructor and Description |
|---|
RoutingActor(Connection connection,
RefTable refTable)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
processMessage(Connection connection,
Object receivedMessage)
Process a received message by dispatching it to the object that the
message addresses as its target, according to the
RefTable that
was provided in this actor's constructor. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectionDiedpublic RoutingActor(Connection connection, RefTable refTable)
connection - Connection associated with this actor.refTable - Table for object ref decoding and message dispatch.public void processMessage(Connection connection, Object receivedMessage)
RefTable that
was provided in this actor's constructor.processMessage in interface MessageHandlerconnection - Connection over which the message was received.receivedMessage - The message received. Normally this should be a
JSONObject, but it could be a Throwable indicating a
problem receiving or parsing the message.Copyright © 2017. All rights reserved.