org.elkoserver.foundation.actor
Class RoutingActor
java.lang.Object
org.elkoserver.foundation.actor.Actor
org.elkoserver.foundation.actor.RoutingActor
- All Implemented Interfaces:
- Deliverer, DispatchTarget, MessageHandler
- Direct Known Subclasses:
- InternalActor, ServiceActor, WorkshopActor
public abstract class RoutingActor
- extends Actor
- implements DispatchTarget
An 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).
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RoutingActor
public RoutingActor(Connection connection,
RefTable refTable)
- Constructor.
- Parameters:
connection - Connection associated with this actor.refTable - Table for object ref decoding and message dispatch.
processMessage
public 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.
- Specified by:
processMessage in interface MessageHandler
- Parameters:
connection - 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.