Class PrioritizedPendingList

java.lang.Object
org.apache.activemq.broker.region.cursors.PrioritizedPendingList
All Implemented Interfaces:
Iterable<org.apache.activemq.broker.region.MessageReference>, PendingList

public class PrioritizedPendingList extends Object implements PendingList
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAll(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.
    void
    Discards all Messages currently held in the PendingList.
    boolean
    contains(org.apache.activemq.broker.region.MessageReference message)
    Query the PendingList to determine if the given message is contained within.
    org.apache.activemq.broker.region.MessageReference
    get(org.apache.activemq.command.MessageId messageId)
     
    getList(org.apache.activemq.broker.region.MessageReference msg)
     
    protected int
    getPriority(org.apache.activemq.broker.region.MessageReference message)
     
    boolean
    Returns true if there are no Messages in the PendingList currently.
    Iterator<org.apache.activemq.broker.region.MessageReference>
    Returns an iterator over the pending Messages.
    long
     
    remove(org.apache.activemq.broker.region.MessageReference message)
    Removes the given MessageReference from the PendingList if it is contained within.
    int
    Returns the number of MessageReferences that are awaiting dispatch.
     
    Collection<org.apache.activemq.broker.region.MessageReference>
    Returns a new Collection that contains all the MessageReferences currently held in this PendingList.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • PrioritizedPendingList

      public PrioritizedPendingList()
  • Method Details

    • addMessageFirst

      public PendingNode addMessageFirst(org.apache.activemq.broker.region.MessageReference message)
      Description copied from interface: PendingList
      Adds the given message to the head of the list.
      Specified by:
      addMessageFirst in interface PendingList
      Parameters:
      message - The MessageReference that is to be added to this list.
      Returns:
      the PendingNode that contains the newly added message.
    • addMessageLast

      public PendingNode addMessageLast(org.apache.activemq.broker.region.MessageReference message)
      Description copied from interface: PendingList
      Adds the given message to the tail of the list.
      Specified by:
      addMessageLast in interface PendingList
      Parameters:
      message - The MessageReference that is to be added to this list.
      Returns:
      the PendingNode that contains the newly added message.
    • clear

      public void clear()
      Description copied from interface: PendingList
      Discards all Messages currently held in the PendingList.
      Specified by:
      clear in interface PendingList
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: PendingList
      Returns true if there are no Messages in the PendingList currently.
      Specified by:
      isEmpty in interface PendingList
      Returns:
      true if the PendingList is currently empty.
    • iterator

      public Iterator<org.apache.activemq.broker.region.MessageReference> iterator()
      Description copied from interface: PendingList
      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.
      Specified by:
      iterator in interface Iterable<org.apache.activemq.broker.region.MessageReference>
      Specified by:
      iterator in interface PendingList
      Returns:
      an Iterator that returns MessageReferences contained in this list.
    • remove

      public PendingNode remove(org.apache.activemq.broker.region.MessageReference message)
      Description copied from interface: PendingList
      Removes the given MessageReference from the PendingList if it is contained within.
      Specified by:
      remove in interface PendingList
      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

      public int size()
      Description copied from interface: PendingList
      Returns the number of MessageReferences that are awaiting dispatch.
      Specified by:
      size in interface PendingList
      Returns:
      current count of the pending messages.
    • messageSize

      public long messageSize()
      Specified by:
      messageSize in interface PendingList
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPriority

      protected int getPriority(org.apache.activemq.broker.region.MessageReference message)
    • getList

      protected OrderedPendingList getList(org.apache.activemq.broker.region.MessageReference msg)
    • contains

      public boolean contains(org.apache.activemq.broker.region.MessageReference message)
      Description copied from interface: PendingList
      Query the PendingList to determine if the given message is contained within.
      Specified by:
      contains in interface PendingList
      Parameters:
      message - The Message that is the target of this query.
      Returns:
      true if the MessageReference is contained in this list.
    • values

      public Collection<org.apache.activemq.broker.region.MessageReference> values()
      Description copied from interface: PendingList
      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.
      Specified by:
      values in interface PendingList
      Returns:
      a new Collection containing this lists MessageReferences.
    • addAll

      public void addAll(PendingList pendingList)
      Description copied from interface: PendingList
      Adds all the elements of the given PendingList to this PendingList.
      Specified by:
      addAll in interface PendingList
      Parameters:
      pendingList - The PendingList that is to be added to this collection.
    • get

      public org.apache.activemq.broker.region.MessageReference get(org.apache.activemq.command.MessageId messageId)
      Specified by:
      get in interface PendingList