org.elkoserver.server.context
Class InternalActor

java.lang.Object
  extended by org.elkoserver.foundation.actor.Actor
      extended by org.elkoserver.foundation.actor.RoutingActor
          extended by org.elkoserver.server.context.InternalActor
All Implemented Interfaces:
BasicProtocolActor, Deliverer, DispatchTarget, MessageHandler

public class InternalActor
extends RoutingActor
implements BasicProtocolActor

Actor for an internal connection to a context server from within the server farm. Such connnections may send messages to any addressable object but do not have associated users and are not placed into any context.


Method Summary
 void connectionDied(Connection connection, Throwable reason)
          Handle loss of connection from the actor.
 boolean doAuth(BasicProtocolHandler handler, AuthDesc auth, String label)
          Do the actual work of authorizing an actor.
 void doDisconnect()
          Do the actual work of disconnecting an actor.
 void ensureAuthorized()
          Guard function to guarantee that an operation is being attempted by an actor who is authorized to do it.
 String toString()
           
 
Methods inherited from class org.elkoserver.foundation.actor.RoutingActor
processMessage
 
Methods inherited from class org.elkoserver.foundation.actor.Actor
close, msgAuth, msgAuth, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.elkoserver.foundation.json.Deliverer
send
 

Method Detail

connectionDied

public void connectionDied(Connection connection,
                           Throwable reason)
Handle loss of connection from the actor.

Specified by:
connectionDied in interface MessageHandler
Parameters:
connection - The connection that died.
reason - Exception explaining why.

doAuth

public boolean doAuth(BasicProtocolHandler handler,
                      AuthDesc auth,
                      String label)
Do the actual work of authorizing an actor.

Specified by:
doAuth in interface BasicProtocolActor
Parameters:
handler - Handler requesting the authorization.
auth - Authorization information from the authorization request message, or null if no authorization information was provided.
label - Label (e.g., displayable user name) string from the authorization request message, or "<anonymous>" if no value was specified.
Returns:
true if the authorization succeeded and the session should be allowed to proceed, false if it did not and the session should be disconnected.

doDisconnect

public void doDisconnect()
Do the actual work of disconnecting an actor.

Specified by:
doDisconnect in interface BasicProtocolActor

ensureAuthorized

public void ensureAuthorized()
                      throws MessageHandlerException
Guard function to guarantee that an operation is being attempted by an actor who is authorized to do it.

Throws:
MessageHandlerException

toString

public String toString()
Overrides:
toString in class Object
Returns:
a printable representation of this actor.