kaos.core.csi.usecase
Class SimpleGuardedSender

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

public class SimpleGuardedSender
extends java.lang.Object

$Revision: 1.5 $


Field Summary
protected  KAoSAgentDescription _agentDescription
          This class llustrates an implementation of a SimpleGuardedSender: an entity registered with KAoS via its Guard and capable of sending messages to other entities registered in the KAoS Directory Service.
protected  QueryRegistration _query
           
protected  TransportSupport _transportSupport
           
 
Constructor Summary
SimpleGuardedSender()
           
 
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 SimpleGuardedSender.
 void initialize(java.lang.String name, 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 KAoSAgentDescription _agentDescription
This class llustrates an implementation of a SimpleGuardedSender: an entity registered with KAoS via its Guard and capable of sending messages to other entities registered in the KAoS Directory Service. Each message send is authorized according to the current set of policies stored by the Guard. Configuration data includes: nickname, the name of the entity to send a message to, 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 name is given - sends a message to it


_transportSupport

protected TransportSupport _transportSupport

_query

protected QueryRegistration _query
Constructor Detail

SimpleGuardedSender

public SimpleGuardedSender()
Method Detail

initialize

public void initialize(java.lang.String name,
                       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 SimpleGuardedSender.

hashCode

public int hashCode()
Determines the hash code for the SimpleGuardedSender. The SimpleGuardedSender 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 SimpleGuardedSender.

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 © 2005 IHMC All Rights Reserved.