gr.demokritos.iit.jinsect.distributed
Class ReceiveResultBehaviour

java.lang.Object
  extended by jade.core.behaviours.Behaviour
      extended by jade.core.behaviours.SimpleBehaviour
          extended by jade.core.behaviours.WakerBehaviour
              extended by gr.demokritos.iit.jinsect.distributed.ReceiveResultBehaviour
All Implemented Interfaces:
java.io.Serializable

public class ReceiveResultBehaviour
extends jade.core.behaviours.WakerBehaviour

Implements a behaviour that performs the receiving of a result.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour
jade.core.behaviours.Behaviour.RunnableChangedEvent
 
Field Summary
 
Fields inherited from class jade.core.behaviours.Behaviour
myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
 
Constructor Summary
ReceiveResultBehaviour(ResultsAgent a, long lInterval)
          Initializes the receiving behaviour, with a given interval.
ReceiveResultBehaviour(ResultsAgent a, long lInterval, java.io.PrintStream pResultOutput)
          Initializes the behaviour with a given interval, and a result output stream.
ReceiveResultBehaviour(ResultsAgent a, long lInterval, java.io.PrintStream pResultOutput, boolean bBlocking)
          Initializes the behaviour with a given interval, a result output stream, as well as an indication of whether the wait is blocking.
 
Method Summary
protected  void onWake()
          Performs the result reception event, eighter blocking or non-blocking (see constructor), and outputs result to given strem.
 
Methods inherited from class jade.core.behaviours.WakerBehaviour
action, done, getWakeupTime, handleElapsedTimeout, reset, reset, stop
 
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

ReceiveResultBehaviour

public ReceiveResultBehaviour(ResultsAgent a,
                              long lInterval)
Initializes the receiving behaviour, with a given interval. Uses the output stream of the linked agent as output stream.

Parameters:
a - The result agent connected to the behaviour.
lInterval - The interval indicating whem to wake.
See Also:
WakerBehaviour

ReceiveResultBehaviour

public ReceiveResultBehaviour(ResultsAgent a,
                              long lInterval,
                              java.io.PrintStream pResultOutput)
Initializes the behaviour with a given interval, and a result output stream.

Parameters:
a - The result agent connected to the behaviour.
lInterval - The interval indicating whem to wake.
pResultOutput - The stream to use for output.

ReceiveResultBehaviour

public ReceiveResultBehaviour(ResultsAgent a,
                              long lInterval,
                              java.io.PrintStream pResultOutput,
                              boolean bBlocking)
Initializes the behaviour with a given interval, a result output stream, as well as an indication of whether the wait is blocking.

Parameters:
a - The result agent connected to the behaviour.
lInterval - The interval indicating whem to wake.
pResultOutput - The stream to use for output.
bBlocking - If true, then the wait is blocking others until its completion.
Method Detail

onWake

protected void onWake()
Performs the result reception event, eighter blocking or non-blocking (see constructor), and outputs result to given strem. Also keeps track of pending requests and manages completion of the process.

Overrides:
onWake in class jade.core.behaviours.WakerBehaviour