Package com.swiftmq.swiftlet.queue
Class QueueManager
- java.lang.Object
-
- com.swiftmq.swiftlet.Swiftlet
-
- com.swiftmq.swiftlet.queue.QueueManager
-
public abstract class QueueManager extends Swiftlet
The QueueManager manages queues.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.locks.ReentrantLockmultiQueueLockprotected booleanuseGlobalLocking-
Fields inherited from class com.swiftmq.swiftlet.Swiftlet
STATE_ACTIVE, STATE_INACTIVE, STATE_STANDBY
-
-
Constructor Summary
Constructors Constructor Description QueueManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddQueueManagerListener(QueueManagerListener l)Adds a queue manager listener for all queues.abstract voidaddQueueManagerListener(java.lang.String queueName, QueueManagerListener l)Adds a queue manager listener for a distinct queue.abstract voidcreateQueue(java.lang.String queueName, ActiveLogin activeLogin)Creates a queue.abstract voidcreateQueue(java.lang.String queueName, QueueFactory factory)Creates a queue from a specified queue factory.abstract QueueBrowsercreateQueueBrowser(java.lang.String queueName, ActiveLogin activeLogin, Selector selector)Creates a QueueBrowser.abstract QueueReceivercreateQueueReceiver(java.lang.String queueName, ActiveLogin activeLogin, Selector selector)Creates a QueueReceiverabstract QueueSendercreateQueueSender(java.lang.String queueName, ActiveLogin activeLogin)Creates a QueueSender.abstract java.lang.StringcreateTemporaryQueue()Create a temporary queue.abstract voiddeleteQueue(java.lang.String queueName, boolean onEmpty)Deletes a queue.abstract voiddeleteTemporaryQueue(java.lang.String queueName)Delete a temporary queue.abstract java.lang.String[]getDefinedQueueNames()Returns the defined queue names.abstract longgetMaxFlowControlDelay()Returns the maximum flow control delay in millisecondsabstract AbstractQueuegetQueueForInternalUse(java.lang.String queueName)Returns the given queue (internal use only!).abstract booleanisQueueDefined(java.lang.String queueName)Returns wheter a queue with that name is defined.abstract booleanisQueueRunning(java.lang.String queueName)Returns wheter a queue with that name is running.abstract booleanisSystemQueue(java.lang.String queueName)Returns whether the queue is a system queue.abstract booleanisTemporaryQueue(java.lang.String queueName)Returns whether the queue is a temp.booleanisUseGlobaLocking()States whether global locking should be used for multi queue transactionsvoidlockMultiQueue()Applies the global lock for multi queue transactionsabstract voidpurgeQueue(java.lang.String queueName)Purges a queue (deletes the content).abstract voidremoveQueueManagerListener(QueueManagerListener l)Removes a queue manager listener for all queues.abstract voidremoveQueueManagerListener(java.lang.String queueName, QueueManagerListener l)Removes a queue manager listener for a distinct queue.abstract voidsetQueueInboundRedirector(java.lang.String likePredicate, java.lang.String inboundQueueName)Sets an inbound redirector.abstract voidsetQueueOutboundRedirector(java.lang.String likePredicate, java.lang.String outboundQueueName)Sets an outbound redirector.protected voidsetUseGlobalLocking(boolean useGlobalLocking)Sets the global locking flagvoidunlockMultiQueue()Releases the global lock for multi queue transactions-
Methods inherited from class com.swiftmq.swiftlet.Swiftlet
getName, getStartupTime, getState, isSnapshotAvailable, resume, setStartupTime, shutdown, standby, startup
-
-
-
-
Method Detail
-
lockMultiQueue
public void lockMultiQueue()
Applies the global lock for multi queue transactions
-
unlockMultiQueue
public void unlockMultiQueue()
Releases the global lock for multi queue transactions
-
isUseGlobaLocking
public boolean isUseGlobaLocking()
States whether global locking should be used for multi queue transactions- Returns:
- true/false
-
setUseGlobalLocking
protected void setUseGlobalLocking(boolean useGlobalLocking)
Sets the global locking flag- Parameters:
useGlobalLocking- global locking flag
-
isQueueDefined
public abstract boolean isQueueDefined(java.lang.String queueName)
Returns wheter a queue with that name is defined.- Parameters:
queueName- queue name.- Returns:
- true/false.
-
isQueueRunning
public abstract boolean isQueueRunning(java.lang.String queueName)
Returns wheter a queue with that name is running.- Parameters:
queueName- queue name.- Returns:
- true/false.
-
getQueueForInternalUse
public abstract AbstractQueue getQueueForInternalUse(java.lang.String queueName)
Returns the given queue (internal use only!).- Parameters:
queueName- queue name.- Returns:
- queue.
-
createQueueSender
public abstract QueueSender createQueueSender(java.lang.String queueName, ActiveLogin activeLogin) throws QueueException, AuthenticationException, UnknownQueueException
Creates a QueueSender.- Parameters:
queueName- queue name.activeLogin- active login (Swiftlets pass null here).- Returns:
- queue sender.
- Throws:
QueueException- on error.AuthenticationException- thrown by the AuthenticationSwiftlet.UnknownQueueException- if the queue is undefined.
-
createQueueReceiver
public abstract QueueReceiver createQueueReceiver(java.lang.String queueName, ActiveLogin activeLogin, Selector selector) throws QueueException, AuthenticationException, UnknownQueueException
Creates a QueueReceiver- Parameters:
queueName- queue name.activeLogin- active login (Swiftlets pass null here).selector- selector.- Returns:
- queue receiver.
- Throws:
QueueException- on error.AuthenticationException- thrown by the AuthenticationSwiftlet.UnknownQueueException- if the queue is undefined.
-
createQueueBrowser
public abstract QueueBrowser createQueueBrowser(java.lang.String queueName, ActiveLogin activeLogin, Selector selector) throws QueueException, AuthenticationException, UnknownQueueException
Creates a QueueBrowser.- Parameters:
queueName- queue name.activeLogin- active login (Swiftlets pass null here).selector- selector.- Returns:
- queue browser.
- Throws:
QueueException- on error.AuthenticationException- thrown by the AuthenticationSwiftlet.UnknownQueueException- if the queue is undefined.
-
addQueueManagerListener
public abstract void addQueueManagerListener(QueueManagerListener l)
Adds a queue manager listener for all queues.- Parameters:
l- listener.
-
addQueueManagerListener
public abstract void addQueueManagerListener(java.lang.String queueName, QueueManagerListener l) throws UnknownQueueExceptionAdds a queue manager listener for a distinct queue.- Parameters:
queueName- queue name.l- listener.- Throws:
UnknownQueueException- if the queue is undefined.
-
removeQueueManagerListener
public abstract void removeQueueManagerListener(QueueManagerListener l)
Removes a queue manager listener for all queues.- Parameters:
l- listener.
-
removeQueueManagerListener
public abstract void removeQueueManagerListener(java.lang.String queueName, QueueManagerListener l) throws UnknownQueueExceptionRemoves a queue manager listener for a distinct queue.- Parameters:
queueName- queue name.l- listener.- Throws:
UnknownQueueException- if the queue is undefined.
-
createQueue
public abstract void createQueue(java.lang.String queueName, ActiveLogin activeLogin) throws QueueException, QueueAlreadyDefinedException, AuthenticationExceptionCreates a queue.- Parameters:
queueName- queue name.activeLogin- active login (Swiftlets pass null here).- Throws:
QueueException- on error.QueueAlreadyDefinedException- if the queue is already defined.AuthenticationException- thrown by the AuthenticationSwiftlet.
-
createQueue
public abstract void createQueue(java.lang.String queueName, QueueFactory factory) throws QueueException, QueueAlreadyDefinedExceptionCreates a queue from a specified queue factory.- Parameters:
queueName- queue name.factory- queue factory.- Throws:
QueueException- on error.QueueAlreadyDefinedException- if the queue is already defined.
-
deleteQueue
public abstract void deleteQueue(java.lang.String queueName, boolean onEmpty) throws UnknownQueueException, QueueExceptionDeletes a queue.- Parameters:
queueName- queue name.onEmpty- true: queue will only be deleted if empty.- Throws:
UnknownQueueException- if the queue is undefined.QueueException- on error.
-
createTemporaryQueue
public abstract java.lang.String createTemporaryQueue() throws QueueExceptionCreate a temporary queue.- Returns:
- queue name.
- Throws:
QueueException- on error.
-
deleteTemporaryQueue
public abstract void deleteTemporaryQueue(java.lang.String queueName) throws UnknownQueueException, QueueExceptionDelete a temporary queue.- Parameters:
queueName- queue name.- Throws:
UnknownQueueException- if the queue is undefined.QueueException- on error.
-
purgeQueue
public abstract void purgeQueue(java.lang.String queueName) throws UnknownQueueException, QueueExceptionPurges a queue (deletes the content).- Parameters:
queueName- queue name.- Throws:
UnknownQueueException- if the queue is undefined.QueueException- on error.
-
getDefinedQueueNames
public abstract java.lang.String[] getDefinedQueueNames()
Returns the defined queue names.- Returns:
- defined queue names.
-
setQueueOutboundRedirector
public abstract void setQueueOutboundRedirector(java.lang.String likePredicate, java.lang.String outboundQueueName) throws UnknownQueueExceptionSets an outbound redirector. This maps a SQL Like predicate to a queue name. This predicate is checked on queue sender creation and, if it matches for the queue name the sender should be created for, it will redirected to the queue specified for this predicate. Example: If%@router2is the predicate and the outbound queue name isrt$router2, a queue sender fortestqueue@router2is redirected to queuert$router2which is the routing queue for router2.- Parameters:
likePredicate- predicate.outboundQueueName- queue name.- Throws:
UnknownQueueException- if the queue is undefined.
-
setQueueInboundRedirector
public abstract void setQueueInboundRedirector(java.lang.String likePredicate, java.lang.String inboundQueueName) throws UnknownQueueExceptionSets an inbound redirector. This maps a SQL Like predicate to a queue name. This predicate is checked on queue receiver creation and, if it matches for the queue name the receiver should be created for, it will redirected to the queue specified for this predicate.- Parameters:
likePredicate- predicate.outboundQueueName- queue name.- Throws:
UnknownQueueException- if the queue is undefined.
-
isTemporaryQueue
public abstract boolean isTemporaryQueue(java.lang.String queueName)
Returns whether the queue is a temp. queue.- Parameters:
queueName- queue name.- Returns:
- true/false.
-
isSystemQueue
public abstract boolean isSystemQueue(java.lang.String queueName)
Returns whether the queue is a system queue.- Parameters:
queueName- queue name.- Returns:
- true/false.
-
getMaxFlowControlDelay
public abstract long getMaxFlowControlDelay()
Returns the maximum flow control delay in milliseconds- Returns:
- max flow control delay
-
-