kaos.core.util
Class MethodCallRequestHandler

java.lang.Object
  extended by kaos.core.util.MethodCallRequestHandler
Direct Known Subclasses:
ActionMethodRequestHandler, DSCoordinatorImpl, ExecutionManager, KAoSGuardImpl, KAoSRobot, SpatialDB

public abstract class MethodCallRequestHandler
extends java.lang.Object

Extending this class allows your methods to be called remotely by other entities who send you a MethodCallRequestMsg. This class takes care of binding to the message transport system, receiving MethodCallRequestMsgs, parsing them, calling the appropriate method on the superclass, and sending the reply as a MethodCallResultMsg


Field Summary
protected  KAoSAgentDescription _agentDescription
           
protected  MethodCallRequestHelper _helper
           
protected  Logger _logger
           
protected  MessageTransportService _mts
           
 java.lang.String _nickName
           
protected  java.lang.String DEFAULT_NICKNAME
           
 Locator myLocator
           
 MessageReceiver myMessageReceiver
           
 MessageSender myMessageSender
           
 
Constructor Summary
MethodCallRequestHandler()
           
 
Method Summary
 void bindToTransport(KAoSAgentDescription desc)
           
protected  void handleMsgContent(Msg aMsg)
           
protected  void handleObjContent(java.lang.Object obj)
           
 Locator initialize(MessageTransportService mts, JasBean entityEnv)
          This method initializes the MethodCallRequestHandler to receive messages from remote entities, using the entityEnv to obtain its local locator.
 void receiveMessage(TransportMessage msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NICKNAME

protected java.lang.String DEFAULT_NICKNAME

myLocator

public Locator myLocator

myMessageReceiver

public MessageReceiver myMessageReceiver

myMessageSender

public MessageSender myMessageSender

_helper

protected MethodCallRequestHelper _helper

_nickName

public java.lang.String _nickName

_mts

protected MessageTransportService _mts

_agentDescription

protected KAoSAgentDescription _agentDescription

_logger

protected Logger _logger
Constructor Detail

MethodCallRequestHandler

public MethodCallRequestHandler()
Method Detail

initialize

public Locator initialize(MessageTransportService mts,
                          JasBean entityEnv)
                   throws java.lang.Exception
This method initializes the MethodCallRequestHandler to receive messages from remote entities, using the entityEnv to obtain its local locator. Note that the entityEnv should also contain the agent's nickname, if there is one, as the value of the key KAoSConstants.NAME

Throws:
java.lang.Exception

bindToTransport

public void bindToTransport(KAoSAgentDescription desc)
                     throws java.lang.Exception
Throws:
java.lang.Exception

receiveMessage

public void receiveMessage(TransportMessage msg)

handleMsgContent

protected void handleMsgContent(Msg aMsg)

handleObjContent

protected void handleObjContent(java.lang.Object obj)