org.kaariboga.agents
Class MessageReceiver

java.lang.Object
  |
  +--org.kaariboga.core.Kaariboga
        |
        +--org.kaariboga.agents.MessageReceiver
All Implemented Interfaces:
KbMessageHandler, java.lang.Runnable, java.io.Serializable

public class MessageReceiver
extends Kaariboga

The MessageReceiver agent waits for a message and then prints it out.

See Also:
Serialized Form

Inner classes inherited from class org.kaariboga.core.Kaariboga
Kaariboga.FireEventThread, Kaariboga.FireMessageThread
 
Fields inherited from class org.kaariboga.core.Kaariboga
base, destination, kaaribogaListener, messageListener, name
 
Constructor Summary
MessageReceiver(java.lang.String name)
          Just initialize the super class.
 
Method Summary
 void handleMessage(KaaribogaMessage msg)
          Prints kind and content of the received message to the screen.
 
Methods inherited from class org.kaariboga.core.Kaariboga
addKaaribogaListener, addKaaribogaMessageListener, fireDestroyRequest, fireDispatchRequest, fireKaaribogaMessage, fireSleepRequest, getDestination, getName, onArrival, onAwake, onCreate, onDestroy, onDispatch, onSleep, run, setBase, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Constructor Detail

MessageReceiver

public MessageReceiver(java.lang.String name)
Just initialize the super class.
Parameters:
name - The name of the agent. This name has to be unique. Normally the KaaribogaBase class provides some method to generate a unique name.
Method Detail

handleMessage

public void handleMessage(KaaribogaMessage msg)
Prints kind and content of the received message to the screen.
Overrides:
handleMessage in class Kaariboga
Parameters:
msg - The message that this agent receives.