org.apache.qpid.util
Interface MessageQueue<E>

All Superinterfaces:
Collection<E>, Iterable<E>, Queue<E>
All Known Implementing Classes:
ConcurrentLinkedMessageQueueAtomicSize

public interface MessageQueue<E>
extends Queue<E>

Defines a queue that has a push operation to add an element to the head of the queue.

Todo:
Seems like this may be pointless, the implementation uses this method to increment the message count then calls offer. Why not simply override offer and drop this interface?

Method Summary
 boolean pushHead(E o)
          Inserts the specified element into this queue, if possible.
 
Methods inherited from interface java.util.Queue
add, element, offer, peek, poll, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

pushHead

boolean pushHead(E o)
Inserts the specified element into this queue, if possible. When using queues that may impose insertion restrictions (for example capacity bounds), method offer is generally preferable to method Collection.add(E), which can fail to insert an element only by throwing an exception.

Parameters:
o - The element to insert.
Returns:
true if it was possible to add the element to this queue, else false


Licensed to the Apache Software Foundation