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
,EventListener
- Direct Known Subclasses:
QueueBrowser
,QueueTransactionHandler
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
Modifier and TypeMethodDescriptionvoid
close()
Close the QueueHandlerlong
Returns the number of messages in the queueReturns the queue nameboolean
isClosed()
Returns if the QueueHandler is closedvoid
Will be called from the QueueManager if a queue should be stopped.protected void
Verifies the state of the handler.Methods inherited from class com.swiftmq.swiftlet.queue.event.QueueManagerAdapter
queueStarted, queueStartInitiated, queueStopped
-
Method Details
-
getQueueName
Returns the queue name- Returns:
- queue name
-
getNumberQueueMessages
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
Close the QueueHandler- Throws:
QueueException
- thrown by the queueQueueHandlerClosedException
- thrown by the handler
-
queueStopInitiated
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
Verifies the state of the handler. If the handler is closed, a QueueHandlerClosedException will be thrown- Throws:
QueueHandlerClosedException
- if the handler is closed
-