Package org.apache.activemq.memory.list
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 sizeMessageList
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()
SimpleMessageList(int maximumSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(MessageReference node)
Message[]
browse(ActiveMQDestination destination)
void
clear()
List<MessageReference>
getList()
Returns a copy of the listList<MessageReference>
getMessages(ActiveMQDestination destination)
Returns the current list of MessageReference objects for the given subscriptionint
getSize()
-
-
-
Method Detail
-
add
public void add(MessageReference node)
- Specified by:
add
in interfaceMessageList
-
getMessages
public List<MessageReference> getMessages(ActiveMQDestination destination)
Description copied from interface:MessageList
Returns the current list of MessageReference objects for the given subscription- Specified by:
getMessages
in interfaceMessageList
-
browse
public Message[] browse(ActiveMQDestination destination)
- Specified by:
browse
in interfaceMessageList
- Returns:
- an array of Messages that match the destination
-
getList
public List<MessageReference> getList()
Returns a copy of the list
-
getSize
public int getSize()
-
clear
public void clear()
- Specified by:
clear
in interfaceMessageList
-
-