ibspan.tss.messaging
Class ServiceWaiter

java.lang.Object
  extended by jade.core.behaviours.Behaviour
      extended by jade.core.behaviours.SimpleBehaviour
          extended by ibspan.tss.messaging.ServiceWaiter
All Implemented Interfaces:
Serializable

public class ServiceWaiter
extends SimpleBehaviour

This behaviours support an agent in pausing his acting until the specific service, which the given ServiceFinder observes, registers in Directory Facilitator.

Behaviours get into blocking state ("fall asleep") until ServiceFinder object wakes it up.

Author:
Maciej Gawinecki
See Also:
ServiceFinder, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
 
Field Summary
 
Fields inherited from class jade.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
 
Constructor Summary
ServiceWaiter(Agent a, ServiceFinder requiredFinder)
          Constructs ServiceWaiter behaviour waiting for the service observed by the given ServiceFinder object.
 
Method Summary
 void action()
           
 boolean done()
           
 
Methods inherited from class jade.core.behaviours.SimpleBehaviour
reset
 
Methods inherited from class jade.core.behaviours.Behaviour
actionWrapper, block, block, getBehaviourName, getDataStore, getExecutionState, getParent, handle, isRunnable, onEnd, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceWaiter

public ServiceWaiter(Agent a,
                     ServiceFinder requiredFinder)
Constructs ServiceWaiter behaviour waiting for the service observed by the given ServiceFinder object.

Parameters:
a - is the agent this behaviour belongs to
requiredFinder - is finder for which looks for particular service.
Method Detail

action

public void action()
Specified by:
action in class Behaviour

done

public boolean done()
Specified by:
done in class Behaviour