fr.dyade.aaa.agent.MessageQueue Interface Reference

Inherited by fr.dyade.aaa.agent.MessageVector.

Inheritance diagram for fr.dyade.aaa.agent.MessageQueue:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void insert (Message item)
void push (Message item)
Message pop () throws EmptyQueueException
void validate ()
Message get () throws InterruptedException
Message get (long timeout) throws InterruptedException
int size ()

Detailed Description

Interface MessageQueue represents a First-In-First-Out (FIFO) persistent list of Message (source and target agent identifier, notification).

Definition at line 33 of file MessageQueue.java.


Member Function Documentation

void fr.dyade.aaa.agent.MessageQueue.insert ( Message  item  ) 

Insert a message in the queue, it should only be used during initialization for restoring the queue state.

Parameters:
item the message to be pushed onto this queue.

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.Engine.insert().

void fr.dyade.aaa.agent.MessageQueue.push ( Message  item  ) 

Pushes a message onto the bottom of this queue. It should only be used during a transaction. The item will be really available after the transaction commit and the queue validate.

Parameters:
item the message to be pushed onto this queue.

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.Engine.post().

Message fr.dyade.aaa.agent.MessageQueue.pop (  )  throws EmptyQueueException

Removes the message at the top of this queue. It must only be used during a transaction.

Returns:
The message at the top of this queue.
Exceptions:
EmptyQueueException if this queue is empty.

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.Engine.abort(), fr.dyade.aaa.agent.GCEngine.commit(), fr.dyade.aaa.agent.Engine.commit(), and fr.dyade.aaa.agent.Engine.run().

void fr.dyade.aaa.agent.MessageQueue.validate (  ) 

Atomicaly validates all messages pushed in queue during a reaction. It must only be used during a transaction.

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.Engine.validate().

Message fr.dyade.aaa.agent.MessageQueue.get (  )  throws InterruptedException

Looks at the message at the top of this queue without removing it from the queue. It should never be used during a transaction to avoid dead-lock problems.

Returns:
the message at the top of this queue.
Exceptions:
InterruptedException if another thread has interrupted the current thread.

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.Engine.run().

Message fr.dyade.aaa.agent.MessageQueue.get ( long  timeout  )  throws InterruptedException

Looks at the message at the top of this queue without removing it from the queue. It waits until a message is available or the specified amount of time has elapsed. It should never be used during a transaction to avoid dead-lock problems.

Parameters:
timeout the maximum time to wait in milliseconds.
Returns:
the message at the top of this queue.
Exceptions:
InterruptedException if another thread has interrupted the current thread.
IllegalArgumentException if the value of timeout is negative.

Implemented in fr.dyade.aaa.agent.MessageVector.

int fr.dyade.aaa.agent.MessageQueue.size (  ) 

Returns the number of messages in this MessageQueue object. Be careful, the result includes messages to be validated.

Returns:
the size of the MessageQueue

Implemented in fr.dyade.aaa.agent.MessageVector.

Referenced by fr.dyade.aaa.agent.HAEngine.commit(), fr.dyade.aaa.agent.GCEngine.commit(), fr.dyade.aaa.agent.Engine.getNbWaitingMessages(), and fr.dyade.aaa.agent.HAEngine.receiveFromJGroups().


The documentation for this interface was generated from the following file:
Generated on Tue Sep 16 16:16:32 2008 for joram by  doxygen 1.5.0