Interface PendingList
- All Superinterfaces:
Iterable<org.apache.activemq.broker.region.MessageReference>
- All Known Implementing Classes:
OrderedPendingList, PrioritizedPendingList, QueueDispatchPendingList
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(PendingList pendingList) Adds all the elements of the given PendingList to this PendingList.addMessageFirst(org.apache.activemq.broker.region.MessageReference message) Adds the given message to the head of the list.addMessageLast(org.apache.activemq.broker.region.MessageReference message) Adds the given message to the tail of the list.voidclear()Discards all Messages currently held in the PendingList.booleancontains(org.apache.activemq.broker.region.MessageReference message) Query the PendingList to determine if the given message is contained within.org.apache.activemq.broker.region.MessageReferenceget(org.apache.activemq.command.MessageId messageId) booleanisEmpty()Returns true if there are no Messages in the PendingList currently.Iterator<org.apache.activemq.broker.region.MessageReference> iterator()Returns an iterator over the pending Messages.longremove(org.apache.activemq.broker.region.MessageReference message) Removes the given MessageReference from the PendingList if it is contained within.intsize()Returns the number of MessageReferences that are awaiting dispatch.Collection<org.apache.activemq.broker.region.MessageReference> values()Returns a new Collection that contains all the MessageReferences currently held in this PendingList.Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
isEmpty
boolean isEmpty()Returns true if there are no Messages in the PendingList currently.- Returns:
- true if the PendingList is currently empty.
-
clear
void clear()Discards all Messages currently held in the PendingList. -
addMessageFirst
Adds the given message to the head of the list.- Parameters:
message- The MessageReference that is to be added to this list.- Returns:
- the PendingNode that contains the newly added message.
-
addMessageLast
Adds the given message to the tail of the list.- Parameters:
message- The MessageReference that is to be added to this list.- Returns:
- the PendingNode that contains the newly added message.
-
remove
Removes the given MessageReference from the PendingList if it is contained within.- Parameters:
message- The MessageReference that is to be removed to this list.- Returns:
- the PendingNode that contains the removed message or null if the message was not present in this list.
-
size
int size()Returns the number of MessageReferences that are awaiting dispatch.- Returns:
- current count of the pending messages.
-
messageSize
long messageSize() -
iterator
Iterator<org.apache.activemq.broker.region.MessageReference> iterator()Returns an iterator over the pending Messages. The subclass controls how the returned iterator actually traverses the list of pending messages allowing for the order to vary based on factors like Message priority or some other mechanism. -
contains
boolean contains(org.apache.activemq.broker.region.MessageReference message) Query the PendingList to determine if the given message is contained within.- Parameters:
message- The Message that is the target of this query.- Returns:
- true if the MessageReference is contained in this list.
-
values
Collection<org.apache.activemq.broker.region.MessageReference> values()Returns a new Collection that contains all the MessageReferences currently held in this PendingList. The elements of the list are ordered using the same rules as the subclass uses for iteration.- Returns:
- a new Collection containing this lists MessageReferences.
-
addAll
Adds all the elements of the given PendingList to this PendingList.- Parameters:
pendingList- The PendingList that is to be added to this collection.
-
get
org.apache.activemq.broker.region.MessageReference get(org.apache.activemq.command.MessageId messageId)
-