Class SimpleMessageList

java.lang.Object
org.apache.activemq.memory.list.SimpleMessageList
All Implemented Interfaces:
MessageList

public class SimpleMessageList extends Object implements MessageList
A simple fixed size MessageList where there is a single, fixed size list that all messages are added to for simplicity. Though this will lead to possibly slow recovery times as many more messages than is necessary will have to be iterated through for each subscription.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    SimpleMessageList(int maximumSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.apache.activemq.broker.region.MessageReference node)
     
    org.apache.activemq.command.Message[]
    browse(org.apache.activemq.command.ActiveMQDestination destination)
     
    void
     
    List<org.apache.activemq.broker.region.MessageReference>
    Returns a copy of the list
    List<org.apache.activemq.broker.region.MessageReference>
    getMessages(org.apache.activemq.command.ActiveMQDestination destination)
    Returns the current list of MessageReference objects for the given subscription
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleMessageList

      public SimpleMessageList()
    • SimpleMessageList

      public SimpleMessageList(int maximumSize)
  • Method Details

    • add

      public void add(org.apache.activemq.broker.region.MessageReference node)
      Specified by:
      add in interface MessageList
    • getMessages

      public List<org.apache.activemq.broker.region.MessageReference> getMessages(org.apache.activemq.command.ActiveMQDestination destination)
      Description copied from interface: MessageList
      Returns the current list of MessageReference objects for the given subscription
      Specified by:
      getMessages in interface MessageList
    • browse

      public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination destination)
      Specified by:
      browse in interface MessageList
      Returns:
      an array of Messages that match the destination
    • getList

      public List<org.apache.activemq.broker.region.MessageReference> getList()
      Returns a copy of the list
    • getSize

      public int getSize()
    • clear

      public void clear()
      Specified by:
      clear in interface MessageList