org.jacorb.notification.queue
Class AbstractBoundedEventQueue
java.lang.Object
org.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractBoundedEventQueue
protected AbstractBoundedEventQueue(int capacity,
EventQueueOverflowStrategy overflowStrategy)
AbstractBoundedEventQueue
protected AbstractBoundedEventQueue(int capacity)
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