Package com.swiftmq.swiftlet.queue
Class QueueHandler
- java.lang.Object
-
- com.swiftmq.swiftlet.queue.event.QueueManagerAdapter
-
- com.swiftmq.swiftlet.queue.QueueHandler
-
- All Implemented Interfaces:
QueueManagerListener,java.util.EventListener
- Direct Known Subclasses:
QueueBrowser,QueueTransactionHandler
public class QueueHandler extends QueueManagerAdapter
QueueHandler is an internal base class for QueueBrowsers and QueueTransactionHandler. It is an extension of QueueManagerAdapter and is listening for events if the queue stop is initiated and does the appropriate actions.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the QueueHandlerlonggetNumberQueueMessages()Returns the number of messages in the queuejava.lang.StringgetQueueName()Returns the queue namebooleanisClosed()Returns if the QueueHandler is closedvoidqueueStopInitiated(QueueManagerEvent evt)Will be called from the QueueManager if a queue should be stopped.protected voidverifyQueueHandlerState()Verifies the state of the handler.-
Methods inherited from class com.swiftmq.swiftlet.queue.event.QueueManagerAdapter
queueStarted, queueStartInitiated, queueStopped
-
-
-
-
Method Detail
-
getQueueName
public java.lang.String getQueueName()
Returns the queue name- Returns:
- queue name
-
getNumberQueueMessages
public long getNumberQueueMessages() throws QueueException, QueueHandlerClosedExceptionReturns the number of messages in the queue- Returns:
- number of messages
- Throws:
QueueException- thrown by the queueQueueHandlerClosedException- thrown by the handler
-
isClosed
public boolean isClosed()
Returns if the QueueHandler is closed- Returns:
- closed or not
-
close
public void close() throws QueueException, QueueHandlerClosedExceptionClose the QueueHandler- Throws:
QueueException- thrown by the queueQueueHandlerClosedException- thrown by the handler
-
queueStopInitiated
public void queueStopInitiated(QueueManagerEvent evt)
Will be called from the QueueManager if a queue should be stopped. Closes this queue handler.- Specified by:
queueStopInitiatedin interfaceQueueManagerListener- Overrides:
queueStopInitiatedin classQueueManagerAdapter- Parameters:
evt- queue manager event
-
verifyQueueHandlerState
protected void verifyQueueHandlerState() throws QueueHandlerClosedExceptionVerifies the state of the handler. If the handler is closed, a QueueHandlerClosedException will be thrown- Throws:
QueueHandlerClosedException- if the handler is closed
-
-