kaos.core.csi.usecase
Class SimpleSender

java.lang.Object
  extended by kaos.core.csi.usecase.SimpleSender

public class SimpleSender
extends java.lang.Object

$Revision: 1.3 $


Field Summary
protected  kaos.core.service.directory.KAoSAgentDescription _agentDescription
          This class llustrates an implementation of a SimpleSender: an entity capable of sending messages.
protected  QueryRegistration _query
           
protected  TransportSupport _transportSupport
           
 
Constructor Summary
SimpleSender()
           
 
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 SimpleSender.
 void initialize(java.lang.String name, kaos.core.service.directory.KAoSAgentDescription agentDescription, java.lang.String transportName)
           
static void main(java.lang.String[] args)
           
 void receiveMessage(TransportMessage tmsg)
          Implements the receiveMessage method mandated by the MessageListener interface.
 void sendMessageTo(java.lang.String receiverName)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_agentDescription

protected kaos.core.service.directory.KAoSAgentDescription _agentDescription
This class llustrates an implementation of a SimpleSender: an entity capable of sending messages. Configuration data includes: nickname, names of kaos domains it will register in, name of a transport to use for communication within KAoS. Bootstrapping steps: - obtains a reference to CSI Registration - binds itself to CSI Transport - asks CSI Registration to create a KAoSAgentDescription for itself - asks CSI Registration to register with KAoS Running - looks up another agent, whose nameis given - sends a message to it


_transportSupport

protected TransportSupport _transportSupport

_query

protected QueryRegistration _query
Constructor Detail

SimpleSender

public SimpleSender()
Method Detail

initialize

public void initialize(java.lang.String name,
                       kaos.core.service.directory.KAoSAgentDescription agentDescription,
                       java.lang.String transportName)
                throws java.lang.Exception
Throws:
java.lang.Exception

receiveMessage

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


equals

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

Overrides:
equals in class java.lang.Object
Returns:
true if obj equals this SimpleSender.

hashCode

public int hashCode()
Determines the hash code for the SimpleSender. The SimpleSender 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 java.lang.Object
Returns:
int the hashCode for this SimpleSender.

sendMessageTo

public void sendMessageTo(java.lang.String receiverName)
                   throws DirectoryFailure,
                          SearchException,
                          NotLocatableException,
                          TransportFailure
Throws:
DirectoryFailure
SearchException
NotLocatableException
TransportFailure

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2006 IHMC All Rights Reserved.