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 void
close()
Close the QueueHandlerlong
getNumberQueueMessages()
Returns the number of messages in the queuejava.lang.String
getQueueName()
Returns the queue nameboolean
isClosed()
Returns if the QueueHandler is closedvoid
queueStopInitiated(QueueManagerEvent evt)
Will be called from the QueueManager if a queue should be stopped.protected void
verifyQueueHandlerState()
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, QueueHandlerClosedException
Returns 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, QueueHandlerClosedException
Close 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:
queueStopInitiated
in interfaceQueueManagerListener
- Overrides:
queueStopInitiated
in classQueueManagerAdapter
- Parameters:
evt
- queue manager event
-
verifyQueueHandlerState
protected void verifyQueueHandlerState() throws QueueHandlerClosedException
Verifies the state of the handler. If the handler is closed, a QueueHandlerClosedException will be thrown- Throws:
QueueHandlerClosedException
- if the handler is closed
-
-