kaos.core.service.util
Class MethodCallProxyHelper

java.lang.Object
  extended by kaos.core.service.util.MethodCallProxyHelper
All Implemented Interfaces:
MsgSender

public class MethodCallProxyHelper
extends java.lang.Object
implements MsgSender

Author:
KAoS Team $Revision: 1.5 $ MethodCallProxyHelper is a convenience class for binding a MethodCallProxy to a MessageTransportService. It takes care of sending messages from the MethodCallProxy to a given destination, (as specified in the initialize() params) and forwards received messages back to the MethodCallProxy.

Field Summary
protected  JasBean _entityEnv
           
protected static Logger _logger
           
protected  Locator _myLocator
           
protected  java.lang.String _nickName
           
protected static java.lang.String _NICKNAME_ROOT
           
protected  MethodCallProxy _proxy
           
protected  Locator _remoteLocator
           
protected  java.lang.String _remoteNickname
           
protected  MessageSender _sender
           
 
Constructor Summary
MethodCallProxyHelper(MethodCallProxy proxy)
           
 
Method Summary
protected  Locator bindToMessageTransportService(MessageTransportService mts)
          Obtain transport specific parameters, if any, obtain the Locator and MessageReceiver for this MethodCallProxyHelper, and bind the Locator to the MessageReceiver.
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean initialize(MessageTransportService mts, JasBean entityEnv, Locator remoteLocator, java.lang.String remoteNickname)
           
protected  JasBean obtainEntityEnv()
           
 void receiveMessage(TransportMessage msg)
          Receive a TransportMessage message from the MessageReceiver.
 void sendMessage(Msg msgOut)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_NICKNAME_ROOT

protected static final java.lang.String _NICKNAME_ROOT
See Also:
Constant Field Values

_remoteNickname

protected java.lang.String _remoteNickname

_nickName

protected java.lang.String _nickName

_sender

protected MessageSender _sender

_myLocator

protected Locator _myLocator

_remoteLocator

protected Locator _remoteLocator

_entityEnv

protected JasBean _entityEnv

_proxy

protected MethodCallProxy _proxy

_logger

protected static final Logger _logger
Constructor Detail

MethodCallProxyHelper

public MethodCallProxyHelper(MethodCallProxy proxy)
Method Detail

initialize

public boolean initialize(MessageTransportService mts,
                          JasBean entityEnv,
                          Locator remoteLocator,
                          java.lang.String remoteNickname)

sendMessage

public void sendMessage(Msg msgOut)
                 throws java.lang.Exception
Specified by:
sendMessage in interface MsgSender
Throws:
java.lang.Exception

receiveMessage

public void receiveMessage(TransportMessage msg)
Receive a TransportMessage message from the MessageReceiver. Unwrap the TransportMessage to get the MethodCallResultMsg from the DomainManager. Notify the correct waiter object, blocking a Thread that invoked the Directory operation, whose results were just received in this receiveMessage call. Based on the result, the notification will unblock the waiting Thread, which will either deliver the DomainManager's reply to the correct invoker, or throw an exception, if the the DomainManager threw one as a reply.

Parameters:
msg - the TransportMessage containing DomainManager's reply to one of: register/deregister/modify/search/removeExecEnv requests.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

bindToMessageTransportService

protected Locator bindToMessageTransportService(MessageTransportService mts)
                                         throws java.lang.Exception
Obtain transport specific parameters, if any, obtain the Locator and MessageReceiver for this MethodCallProxyHelper, and bind the Locator to the MessageReceiver.

Throws:
java.lang.Exception

obtainEntityEnv

protected JasBean obtainEntityEnv()