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 Details

    • multiQueueLock

      protected ReentrantLock multiQueueLock
    • useGlobalLocking

      protected boolean useGlobalLocking
  • Constructor Details

    • QueueManager

      public QueueManager()
  • Method Details

    • 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(String queueName)
      Returns wheter a queue with that name is defined.
      Parameters:
      queueName - queue name.
      Returns:
      true/false.
    • isQueueRunning

      public abstract boolean isQueueRunning(String queueName)
      Returns wheter a queue with that name is running.
      Parameters:
      queueName - queue name.
      Returns:
      true/false.
    • getQueueForInternalUse

      public abstract AbstractQueue getQueueForInternalUse(String queueName)
      Returns the given queue (internal use only!).
      Parameters:
      queueName - queue name.
      Returns:
      queue.
    • createQueueSender

      public abstract QueueSender createQueueSender(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(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(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(String queueName, QueueManagerListener l) throws UnknownQueueException
      Adds 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(String queueName, QueueManagerListener l) throws UnknownQueueException
      Removes 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(String queueName, ActiveLogin activeLogin) throws QueueException, QueueAlreadyDefinedException, AuthenticationException
      Creates 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(String queueName, QueueFactory factory) throws QueueException, QueueAlreadyDefinedException
      Creates 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(String queueName, boolean onEmpty) throws UnknownQueueException, QueueException
      Deletes 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 String createTemporaryQueue() throws QueueException
      Create a temporary queue.
      Returns:
      queue name.
      Throws:
      QueueException - on error.
    • deleteTemporaryQueue

      public abstract void deleteTemporaryQueue(String queueName) throws UnknownQueueException, QueueException
      Delete a temporary queue.
      Parameters:
      queueName - queue name.
      Throws:
      UnknownQueueException - if the queue is undefined.
      QueueException - on error.
    • purgeQueue

      public abstract void purgeQueue(String queueName) throws UnknownQueueException, QueueException
      Purges a queue (deletes the content).
      Parameters:
      queueName - queue name.
      Throws:
      UnknownQueueException - if the queue is undefined.
      QueueException - on error.
    • getDefinedQueueNames

      public abstract String[] getDefinedQueueNames()
      Returns the defined queue names.
      Returns:
      defined queue names.
    • setQueueOutboundRedirector

      public abstract void setQueueOutboundRedirector(String likePredicate, String outboundQueueName) throws UnknownQueueException
      Sets 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 %@router2 is the predicate and the outbound queue name is rt$router2, a queue sender for testqueue@router2 is redirected to queue rt$router2 which is the routing queue for router2.
      Parameters:
      likePredicate - predicate.
      outboundQueueName - queue name.
      Throws:
      UnknownQueueException - if the queue is undefined.
    • setQueueInboundRedirector

      public abstract void setQueueInboundRedirector(String likePredicate, String inboundQueueName) throws UnknownQueueException
      Sets 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(String queueName)
      Returns whether the queue is a temp. queue.
      Parameters:
      queueName - queue name.
      Returns:
      true/false.
    • isSystemQueue

      public abstract boolean isSystemQueue(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