Package com.swiftmq.swiftlet.queue
Class QueueBrowser
- java.lang.Object
-
- com.swiftmq.swiftlet.queue.event.QueueManagerAdapter
-
- com.swiftmq.swiftlet.queue.QueueHandler
-
- com.swiftmq.swiftlet.queue.QueueBrowser
-
- All Implemented Interfaces:
QueueManagerListener,java.util.EventListener
public class QueueBrowser extends QueueHandler
A QueueBrowser is created by the QueueManager. It provides a method for browsing queue messages outside a transaction.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
- See Also:
QueueManager.createQueueBrowser(java.lang.String, com.swiftmq.swiftlet.auth.ActiveLogin, com.swiftmq.swiftlet.queue.Selector)
-
-
Constructor Summary
Constructors Constructor Description QueueBrowser(ActiveQueue activeQueue, Selector selector, EntityList browserEntityList)Creates a new QueueBrowser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the queue browserMessageEntrygetNextMessage()Get the next available message from the queue.voidresetBrowser()Reset the browser.voidsetLastMessageIndex(MessageIndex lastMessageIndex)-
Methods inherited from class com.swiftmq.swiftlet.queue.QueueHandler
getNumberQueueMessages, getQueueName, isClosed, queueStopInitiated, verifyQueueHandlerState
-
Methods inherited from class com.swiftmq.swiftlet.queue.event.QueueManagerAdapter
queueStarted, queueStartInitiated, queueStopped
-
-
-
-
Constructor Detail
-
QueueBrowser
public QueueBrowser(ActiveQueue activeQueue, Selector selector, EntityList browserEntityList)
Creates a new QueueBrowser- Parameters:
activeQueue- the active queueselector- an optional selectorbrowserEntityList- the browser usage entity list
-
-
Method Detail
-
setLastMessageIndex
public void setLastMessageIndex(MessageIndex lastMessageIndex)
-
resetBrowser
public void resetBrowser()
Reset the browser. It will start at the beginning next time a message is fetched.
-
getNextMessage
public MessageEntry getNextMessage() throws QueueException, QueueHandlerClosedException
Get the next available message from the queue.- Returns:
- message or null
- Throws:
QueueException- thrown by the queueQueueHandlerClosedException- if the handler is closed
-
close
public void close() throws QueueException, QueueHandlerClosedExceptionClose the queue browser- Overrides:
closein classQueueHandler- Throws:
QueueException- thrown by the queueQueueHandlerClosedException- if the browser is already closed
-
-