kaos.core.csi.usecase
Class SimpleReceiver

java.lang.Object
  extended by kaos.core.csi.usecase.SimpleReceiver
All Implemented Interfaces:
kaos.core.service.directory.DirectoryEventListener

public class SimpleReceiver
extends java.lang.Object
implements kaos.core.service.directory.DirectoryEventListener

$Revision: 1.7 $


Field Summary
protected  kaos.core.service.directory.KAoSAgentDescription _agentDescription
          This class illustrates an implementation of a SimpleReceiver: an entity capable of receiving messages.
protected  TransportSupport _transportSupport
           
 
Constructor Summary
SimpleReceiver()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two agents are equal if their respective hash codes are equal.
 int hashCode()
           
 void initialize(java.lang.String name, kaos.core.service.directory.KAoSAgentDescription agentDescription, java.lang.String transportName)
           
 boolean isListeningForEvent(kaos.core.service.directory.DirectoryEvent event)
          Determines if this Listener is listening for the specified event.
static void main(java.lang.String[] args)
           
 void receiveDirectoryEvent(kaos.core.service.directory.DirectoryEvent event)
          Notifies the listener about a directory event.
 void receiveMessage(TransportMessage tmsg)
          Implements the receiveMessage method mandated by the MessageListener interface.
 
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 illustrates an implementation of a SimpleReceiver: an entity capable of receiving 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 register with KAoS using given KAoSAgentDescription Running - waits for messages - acknowledges received messages by sending a reply to sender


_transportSupport

protected TransportSupport _transportSupport
Constructor Detail

SimpleReceiver

public SimpleReceiver()
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. Sends an acknowledgement back to the receiver.


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 SimpleReceiver.

hashCode

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

main

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

isListeningForEvent

public boolean isListeningForEvent(kaos.core.service.directory.DirectoryEvent event)
Description copied from interface: kaos.core.service.directory.DirectoryEventListener
Determines if this Listener is listening for the specified event.

Specified by:
isListeningForEvent in interface kaos.core.service.directory.DirectoryEventListener
Parameters:
event - A directory event to be sent to the appropriate listeners.
Returns:
true if the listener is listening for the event; otherwise return false.

receiveDirectoryEvent

public void receiveDirectoryEvent(kaos.core.service.directory.DirectoryEvent event)
Description copied from interface: kaos.core.service.directory.DirectoryEventListener
Notifies the listener about a directory event.

Specified by:
receiveDirectoryEvent in interface kaos.core.service.directory.DirectoryEventListener
Parameters:
event - A directory event


Copyright © 2006 IHMC All Rights Reserved.