org.jacorb.notification.queue
Interface MessageQueue

All Known Implementing Classes:
AbstractBoundedEventHeap, AbstractBoundedEventQueue, BoundedDeadlineEventQueue, BoundedFifoEventQueue, BoundedPriorityEventQueue, BoundedReceiveTimeEventQueue

public interface MessageQueue

Version:
$Id: MessageQueue.java,v 1.2 2005-08-21 13:32:36 alphonse.bendt Exp $
Author:
Alphonse Bendt

Nested Class Summary
static interface MessageQueue.DiscardListener
           
 
Method Summary
 void addDiscardListener(MessageQueue.DiscardListener listener)
           
 Message[] getAllMessages(boolean wait)
          get all Messages from this queue.
 java.lang.String getDiscardPolicyName()
           
 Message getMessage(boolean wait)
          get the next Message from this queue.
 Message[] getMessages(int n, boolean wait)
          get up to n events from this queue.
 java.lang.String getOrderPolicyName()
           
 int getSize()
          access the current size of this queue.
 boolean isEmpty()
          check if this queue is empty.
 void put(Message event)
          put a Message into this queue.
 void removeDiscardListener(MessageQueue.DiscardListener listener)
           
 

Method Detail

addDiscardListener

void addDiscardListener(MessageQueue.DiscardListener listener)

removeDiscardListener

void removeDiscardListener(MessageQueue.DiscardListener listener)

getMessage

Message getMessage(boolean wait)
                   throws java.lang.InterruptedException
get the next Message from this queue. which particular event is selected depends on the underlying implementation.

Parameters:
wait - a boolean value. If this parameter is set to true the queue will block until an element is available. If the parameter is set to false the queue will return null in case it is empty.
Throws:
java.lang.InterruptedException

getMessages

Message[] getMessages(int n,
                      boolean wait)
                      throws java.lang.InterruptedException
get up to n events from this queue.

Parameters:
n - number of requested messages
wait - a boolean value. If this parameter is set to true the queue will block until an element is available. If the parameter is set to false the queue will return null in case it is empty.
Throws:
java.lang.InterruptedException

getAllMessages

Message[] getAllMessages(boolean wait)
                         throws java.lang.InterruptedException
get all Messages from this queue.

Parameters:
wait - a boolean value. If this parameter is set to true the queue will block until an element is available. If the parameter is set to false the queue will return null in case it is empty.
Throws:
java.lang.InterruptedException

put

void put(Message event)
put a Message into this queue.


isEmpty

boolean isEmpty()
check if this queue is empty.


getSize

int getSize()
access the current size of this queue.


getOrderPolicyName

java.lang.String getOrderPolicyName()

getDiscardPolicyName

java.lang.String getDiscardPolicyName()