org.apache.activemq.store.amq.reader
Class AMQReader

java.lang.Object
  extended by org.apache.activemq.store.amq.reader.AMQReader
All Implemented Interfaces:
java.lang.Iterable<javax.jms.Message>

public class AMQReader
extends java.lang.Object
implements java.lang.Iterable<javax.jms.Message>

Reads and iterates through data log files for the AMQMessage Store


Constructor Summary
AMQReader(java.io.File file)
          Create the AMQReader to read a directory of amq data logs - or an individual data log file
AMQReader(java.io.File file, java.lang.String selector)
          Create the AMQReader to read a directory of amq data logs - or an individual data log file
 
Method Summary
protected  org.apache.activemq.store.amq.reader.MessageLocation getNextMessage(org.apache.activemq.store.amq.reader.MessageLocation lastLocation)
           
 java.util.Iterator<javax.jms.Message> iterator()
           
static java.util.Set<java.io.File> listDataFiles(java.io.File directory)
          List all the data files in a directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMQReader

public AMQReader(java.io.File file)
          throws javax.jms.InvalidSelectorException,
                 java.io.IOException
Create the AMQReader to read a directory of amq data logs - or an individual data log file

Parameters:
file - the directory - or file
Throws:
java.io.IOException
javax.jms.InvalidSelectorException
java.io.IOException
javax.jms.InvalidSelectorException

AMQReader

public AMQReader(java.io.File file,
                 java.lang.String selector)
          throws java.io.IOException,
                 javax.jms.InvalidSelectorException
Create the AMQReader to read a directory of amq data logs - or an individual data log file

Parameters:
file - the directory - or file
selector - the JMS selector or null to select all
Throws:
java.io.IOException
javax.jms.InvalidSelectorException
Method Detail

listDataFiles

public static java.util.Set<java.io.File> listDataFiles(java.io.File directory)
                                                 throws java.io.IOException
List all the data files in a directory

Parameters:
directory -
Returns:
Throws:
java.io.IOException

iterator

public java.util.Iterator<javax.jms.Message> iterator()
Specified by:
iterator in interface java.lang.Iterable<javax.jms.Message>

getNextMessage

protected org.apache.activemq.store.amq.reader.MessageLocation getNextMessage(org.apache.activemq.store.amq.reader.MessageLocation lastLocation)
                                                                       throws java.lang.IllegalStateException,
                                                                              java.io.IOException
Throws:
java.lang.IllegalStateException
java.io.IOException


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.