org.jacorb.notification.queue
Class BoundedFifoEventQueue

java.lang.Object
  extended byorg.jacorb.notification.queue.AbstractBoundedEventQueue
      extended byorg.jacorb.notification.queue.BoundedFifoEventQueue
All Implemented Interfaces:
MessageQueue

public class BoundedFifoEventQueue
extends AbstractBoundedEventQueue

Note that most of the methods are not thread-safe. this causes no problem as the methods are not intended to be directly called by clients. instead the superclass implements the interface EventQueue and invokes the methods thereby synchronizing access.

Version:
$Id: BoundedFifoEventQueue.java,v 1.7 2006/02/25 15:28:40 alphonse.bendt Exp $
Author:
Alphonse Bendt

Nested Class Summary
 
Nested classes inherited from class org.jacorb.notification.queue.MessageQueue
MessageQueue.DiscardListener
 
Constructor Summary
BoundedFifoEventQueue(int maxSize, EventQueueOverflowStrategy overflowStrategy)
           
BoundedFifoEventQueue(int maxSize, EventQueueOverflowStrategy overflowStrategy, java.lang.Object lock)
           
 
Method Summary
protected  void addElement(Message e)
           
protected  Message[] getAllElements()
           
protected  Message getEarliestTimeout()
           
protected  Message[] getElements(int max)
           
protected  Message getLeastPriority()
           
protected  Message getNextElement()
           
protected  Message getOldestElement()
           
 java.lang.String getOrderPolicyName()
           
 int getSize()
          access the current size of this queue.
protected  Message getYoungestElement()
           
 boolean isEmpty()
          check if this queue is empty.
 
Methods inherited from class org.jacorb.notification.queue.AbstractBoundedEventQueue
addDiscardListener, getAllMessages, getDiscardPolicyName, getMessage, getMessages, put, removeDiscardListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedFifoEventQueue

public BoundedFifoEventQueue(int maxSize,
                             EventQueueOverflowStrategy overflowStrategy)

BoundedFifoEventQueue

public BoundedFifoEventQueue(int maxSize,
                             EventQueueOverflowStrategy overflowStrategy,
                             java.lang.Object lock)
Method Detail

getOrderPolicyName

public java.lang.String getOrderPolicyName()
Specified by:
getOrderPolicyName in interface MessageQueue
Specified by:
getOrderPolicyName in class AbstractBoundedEventQueue

isEmpty

public boolean isEmpty()
Description copied from interface: MessageQueue
check if this queue is empty.


getSize

public int getSize()
Description copied from interface: MessageQueue
access the current size of this queue.


getEarliestTimeout

protected Message getEarliestTimeout()
Specified by:
getEarliestTimeout in class AbstractBoundedEventQueue

getLeastPriority

protected Message getLeastPriority()
Specified by:
getLeastPriority in class AbstractBoundedEventQueue

getNextElement

protected Message getNextElement()
Specified by:
getNextElement in class AbstractBoundedEventQueue

getOldestElement

protected Message getOldestElement()
Specified by:
getOldestElement in class AbstractBoundedEventQueue

getYoungestElement

protected Message getYoungestElement()
Specified by:
getYoungestElement in class AbstractBoundedEventQueue

getAllElements

protected Message[] getAllElements()
Specified by:
getAllElements in class AbstractBoundedEventQueue

addElement

protected void addElement(Message e)
Specified by:
addElement in class AbstractBoundedEventQueue

getElements

protected Message[] getElements(int max)
Specified by:
getElements in class AbstractBoundedEventQueue