kaos.core.service.util
Class KAoSAgentMsgForwarder

java.lang.Object
  extended by kaos.core.service.boot.KAoSAgent
      extended by kaos.core.service.util.KAoSAgentMsgForwarder
All Implemented Interfaces:
KAoSAgentHelper

public class KAoSAgentMsgForwarder
extends KAoSAgent

This class extends the KAoSAgent to redirect received messages to external MessageListener. $Revision: 1.1 $


Field Summary
 
Fields inherited from class kaos.core.service.boot.KAoSAgent
_agentDescription, _agentDirectoryService, _agentNamingService, _agentNickname, _lctr, _logger, _messageTransportService, _name, _serviceRoot
 
Constructor Summary
KAoSAgentMsgForwarder()
          Instantiates a new KAoS-aware agent using JAS services for transport, naming and agent directory.
KAoSAgentMsgForwarder(MessageListener listener)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two agents are equal if their respective hash codes are equal.
 int hashCode()
          Determines the hash code for the KAoSAgentMsgForwarder.
 void receiveMessage(TransportMessage tmsg)
          Implements the receiveMessage method mandated by the MessageListener interface.
 void setMessageRecipient(MessageListener listener)
           
 
Methods inherited from class kaos.core.service.boot.KAoSAgent
acquireAgentDirectoryService, acquireAgentName, acquireAgentNamingService, acquireMessageTransportService, assertFalse, assertTrue, bindToMessageTransportService, checkPermission, createTransportMessage, establishAgentDescription, findAgentDescriptionForID, findAgentDescriptionForNickname, getAgentID, getKAoSAgentDescription, initialize, logMessage, logMessage, main, printTransportMessage, sendMessage, verifyRegistration
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KAoSAgentMsgForwarder

public KAoSAgentMsgForwarder()
Instantiates a new KAoS-aware agent using JAS services for transport, naming and agent directory.


KAoSAgentMsgForwarder

public KAoSAgentMsgForwarder(MessageListener listener)
Method Detail

receiveMessage

public void receiveMessage(TransportMessage tmsg)
Implements the receiveMessage method mandated by the MessageListener interface. This method prints the incoming TransportMessage to System.out.

Overrides:
receiveMessage in class KAoSAgent
See Also:
MessageListener, TransportMessage, "JAS Specification, Section(s) 3.4.2, 4.7.2"

equals

public boolean equals(java.lang.Object obj)
Two agents are equal if their respective hash codes are equal.

Overrides:
equals in class KAoSAgent
Returns:
true if obj equals this KAoSAgentMsgForwarder.
See Also:
hashCode(), "JAS Specification, Section(s) 4.7.2"

hashCode

public int hashCode()
Determines the hash code for the KAoSAgentMsgForwarder. The KAoSAgentMsgForwarder hash code is simply the hash code of the represented agents AgentName. If the AgentName field has not yet been set, then the hash code is found from super.hashCode() .

Overrides:
hashCode in class KAoSAgent
Returns:
int the hashCode for this KAoSAgentMsgForwarder.
See Also:
AgentName#hashCode, Object.hashCode(), "JAS Specification, Section(s) 4.7.2"

setMessageRecipient

public void setMessageRecipient(MessageListener listener)