org.apache.activemq.memory.list
Class SimpleMessageList

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

public class SimpleMessageList
extends java.lang.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.

Version:
$Revision: 1.1 $

Constructor Summary
SimpleMessageList()
           
SimpleMessageList(int maximumSize)
           
 
Method Summary
 void add(MessageReference node)
           
 Message[] browse(ActiveMQDestination destination)
           
 void clear()
           
 java.util.List getList()
          Returns a copy of the list
 java.util.List getMessages(Subscription sub)
          Returns the current list of MessageReference objects for the given subscription
 int getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMessageList

public SimpleMessageList()

SimpleMessageList

public SimpleMessageList(int maximumSize)
Method Detail

add

public void add(MessageReference node)
Specified by:
add in interface MessageList

getMessages

public java.util.List getMessages(Subscription sub)
Description copied from interface: MessageList
Returns the current list of MessageReference objects for the given subscription

Specified by:
getMessages in interface MessageList

browse

public Message[] browse(ActiveMQDestination destination)
Specified by:
browse in interface MessageList
Returns:
an array of Messages that match the destination

getList

public java.util.List getList()
Returns a copy of the list


getSize

public int getSize()

clear

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


Copyright © 2009 Apache Software Foundation. All Rights Reserved.