ibspan.tss.agents.pma.learning
Class SynchronizedStore

java.lang.Object
  extended by ibspan.tss.agents.pma.learning.SynchronizedStore

public class SynchronizedStore
extends Object

This class allows competing behaviours of an the to exachange information between them without blocking each other. The behaviour willing to informs another one about new data just call push() method, which wakes up whole Agent, including the behaviour which wait for this data in blocking state.

The class has implemented as queue with FIFO policy.

Author:
Maciej Gawinecki
See Also:
ContinuousLearning, HistorySubscriptionManager

Constructor Summary
SynchronizedStore(Agent a)
          Constructs Synchronized queque
 
Method Summary
 Object pull()
          Removes element from the top of the queque queue (according to FIFO policy).
 void push(Object element)
          Adds given element to the end of the store queue (according to FIFO policy) and wakes up an agent this SynchronizedStore object belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizedStore

public SynchronizedStore(Agent a)
Constructs Synchronized queque

Parameters:
a - is the agent this queque belongs to.
Method Detail

push

public void push(Object element)
Adds given element to the end of the store queue (according to FIFO policy) and wakes up an agent this SynchronizedStore object belongs to.

Parameters:
element - is an element to be added.

pull

public Object pull()
Removes element from the top of the queque queue (according to FIFO policy).

Returns:
the elements that was just removed.