org.jacorb.notification.queue
Class AbstractBoundedEventQueue

java.lang.Object
  extended byorg.jacorb.notification.queue.AbstractBoundedEventQueue
All Implemented Interfaces:
EventQueue
Direct Known Subclasses:
BoundedDeadlineEventQueue, BoundedFifoEventQueue, BoundedPriorityEventQueue

public abstract class AbstractBoundedEventQueue
extends java.lang.Object
implements EventQueue

Version:
$Id: AbstractBoundedEventQueue.java,v 1.6 2004/05/06 12:39:59 nicolas Exp $
Author:
Alphonse Bendt

Constructor Summary
protected AbstractBoundedEventQueue(int capacity)
           
protected AbstractBoundedEventQueue(int capacity, EventQueueOverflowStrategy overflowStrategy)
           
 
Method Summary
protected abstract  void addElement(Message event)
           
protected abstract  Message[] getAllElements()
           
 Message[] getAllEvents(boolean wait)
          get all Messages from this queue.
protected abstract  Message getEarliestTimeout()
           
protected abstract  Message[] getElements(int max)
           
 Message getEvent(boolean wait)
          get the next Message from this queue. which particular event is selected depends on the underlying implementation.
 Message[] getEvents(int max, boolean wait)
          get up to n events from this queue.
protected abstract  Message getLeastPriority()
           
protected abstract  Message getNextElement()
           
protected abstract  Message getOldestElement()
           
protected abstract  Message getYoungestElement()
           
 void put(Message event)
          put a Message into this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jacorb.notification.queue.EventQueue
getSize, isEmpty
 

Constructor Detail

AbstractBoundedEventQueue

protected AbstractBoundedEventQueue(int capacity,
                                    EventQueueOverflowStrategy overflowStrategy)

AbstractBoundedEventQueue

protected AbstractBoundedEventQueue(int capacity)
Method Detail

getEarliestTimeout

protected abstract Message getEarliestTimeout()

getLeastPriority

protected abstract Message getLeastPriority()

getNextElement

protected abstract Message getNextElement()

getOldestElement

protected abstract Message getOldestElement()

getYoungestElement

protected abstract Message getYoungestElement()

getElements

protected abstract Message[] getElements(int max)

addElement

protected abstract void addElement(Message event)

getAllElements

protected abstract Message[] getAllElements()

getAllEvents

public Message[] getAllEvents(boolean wait)
                       throws java.lang.InterruptedException
Description copied from interface: EventQueue
get all Messages from this queue.

Specified by:
getAllEvents in interface EventQueue
Throws:
java.lang.InterruptedException

getEvent

public Message getEvent(boolean wait)
                 throws java.lang.InterruptedException
Description copied from interface: EventQueue
get the next Message from this queue. which particular event is selected depends on the underlying implementation.

Specified by:
getEvent in interface EventQueue
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

getEvents

public Message[] getEvents(int max,
                           boolean wait)
                    throws java.lang.InterruptedException
Description copied from interface: EventQueue
get up to n events from this queue.

Specified by:
getEvents in interface EventQueue
Throws:
java.lang.InterruptedException

put

public void put(Message event)
Description copied from interface: EventQueue
put a Message into this queue.

Specified by:
put in interface EventQueue