Joram ${version}

org.objectweb.joram.client.jms
Class Queue

java.lang.Object
  extended byorg.objectweb.joram.client.jms.admin.AdministeredObject
      extended byorg.objectweb.joram.client.jms.Destination
          extended byorg.objectweb.joram.client.jms.Queue
All Implemented Interfaces:
javax.jms.Destination, javax.jms.Queue, javax.naming.Referenceable, java.io.Serializable, fr.dyade.aaa.jndi2.soap.SoapObjectItf
Direct Known Subclasses:
DeadMQueue, TemporaryQueue

public class Queue
extends Destination
implements javax.jms.Queue

Implements the javax.jms.Queue interface and provides JORAM specific administration and monitoring methods.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.joram.client.jms.Destination
adminName, agentId
 
Constructor Summary
  Queue()
           
  Queue(java.lang.String name)
           
protected Queue(java.lang.String name, java.lang.String type)
           
 
Method Summary
 void addClusteredQueue(Queue addedQueue)
          Adds a queue into the cluster this queue belongs to.
 void clear()
           
static Queue create()
          Admin method creating and deploying a queue on the local server.
static Queue create(int serverId)
          Admin method creating and deploying a queue on a given server.
static Queue create(int serverId, java.util.Properties prop)
          Admin method creating and deploying a queue on a given server.
static Queue create(int serverId, java.lang.String name)
          Admin method creating and deploying (or retrieving) a queue on a given server with a given name.
static Queue create(int serverId, java.lang.String className, java.util.Properties prop)
          Admin method creating and deploying a queue on a given server.
static Queue create(int serverId, java.lang.String name, java.lang.String className, java.util.Properties prop)
          Admin method creating and deploying (or retrieving) a queue on a given server.
static Queue create(java.lang.String name)
          Admin method creating and deploying (or retrieving) a queue on the local server.
 void deleteMessage(java.lang.String msgId)
           
 java.lang.String[] getMessageIds(javax.jms.Queue queue)
           
 int getPendingMessages()
          Monitoring method returning the number of pending messages on this queue.
 int getPendingRequests()
          Monitoring method returning the number of pending requests on this queue.
 java.lang.String[] getQueueClusterElements()
          Returns the reference of the queues that belong to the cluster.
 java.lang.String getQueueName()
          API method.
 int getThreshold()
          Monitoring method returning the threshold of this queue, -1 if not set.
static boolean isQueue(java.lang.String type)
           
 javax.jms.Message readMessage(java.lang.String msgId)
           
 void removeClusteredQueue(Queue removedQueue)
          Removes a queue from the cluster this queue belongs to.
 void setThreshold(int threshold)
          Admin method setting or unsetting the threshold for this queue.
 java.lang.String toString()
          Returns a String image of the queue.
 
Methods inherited from class org.objectweb.joram.client.jms.Destination
code, decode, delete, doCreate, equals, getAdminName, getDMQ, getName, getReaders, getReference, getType, getWriters, isAssignableTo, isFreelyReadable, isFreelyWriteable, isQueue, newInstance, setDMQ, setFreeReading, setFreeWriting, setReader, setWriter, unsetFreeReading, unsetFreeWriting, unsetReader, unsetWriter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Queue

public Queue()

Queue

public Queue(java.lang.String name)

Queue

protected Queue(java.lang.String name,
                java.lang.String type)
Method Detail

isQueue

public static boolean isQueue(java.lang.String type)

toString

public java.lang.String toString()
Returns a String image of the queue.

Specified by:
toString in interface javax.jms.Queue

getQueueName

public java.lang.String getQueueName()
                              throws javax.jms.JMSException
API method.

Specified by:
getQueueName in interface javax.jms.Queue
Throws:
javax.jms.JMSException - Actually never thrown.

create

public static Queue create(int serverId,
                           java.lang.String name,
                           java.lang.String className,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a queue on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the queue.
name - The name of the queue.
className - The queue class name.
prop - The queue properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create(int serverId,
                           java.lang.String className,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a queue on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the queue.
className - The queue class name.
prop - The queue properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create(int serverId,
                           java.util.Properties prop)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a queue on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the queue.
prop - The queue properties.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create(int serverId,
                           java.lang.String name)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a queue on a given server with a given name.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the queue.
name - The queue name.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create(java.lang.String name)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying (or retrieving) a queue on the local server.

The request fails if the destination deployement fails server side.

Parameters:
name - The queue name.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create(int serverId)
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a queue on a given server.

The request fails if the target server does not belong to the platform, or if the destination deployement fails server side.

Parameters:
serverId - The identifier of the server where deploying the queue.
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

create

public static Queue create()
                    throws java.net.ConnectException,
                           AdminException
Admin method creating and deploying a queue on the local server.

The request fails if the destination deployement fails server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

setThreshold

public void setThreshold(int threshold)
                  throws java.net.ConnectException,
                         AdminException
Admin method setting or unsetting the threshold for this queue.

The request fails if the queue is deleted server side.

Parameters:
threshold - The threshold value to be set (-1 for unsetting previous value).
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getThreshold

public int getThreshold()
                 throws java.net.ConnectException,
                        AdminException
Monitoring method returning the threshold of this queue, -1 if not set.

The request fails if the queue is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getPendingMessages

public int getPendingMessages()
                       throws java.net.ConnectException,
                              AdminException
Monitoring method returning the number of pending messages on this queue.

The request fails if the queue is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getPendingRequests

public int getPendingRequests()
                       throws java.net.ConnectException,
                              AdminException
Monitoring method returning the number of pending requests on this queue.

The request fails if the queue is deleted server side.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getMessageIds

public java.lang.String[] getMessageIds(javax.jms.Queue queue)
                                 throws AdminException,
                                        java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

readMessage

public javax.jms.Message readMessage(java.lang.String msgId)
                              throws AdminException,
                                     java.net.ConnectException,
                                     javax.jms.JMSException
Throws:
AdminException
java.net.ConnectException
javax.jms.JMSException

deleteMessage

public void deleteMessage(java.lang.String msgId)
                   throws AdminException,
                          java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

clear

public void clear()
           throws AdminException,
                  java.net.ConnectException
Throws:
AdminException
java.net.ConnectException

addClusteredQueue

public void addClusteredQueue(Queue addedQueue)
                       throws java.net.ConnectException,
                              AdminException
Adds a queue into the cluster this queue belongs to. If this queue doesn't belong to a cluster then a cluster is created by clustering this queue with the added queue.

The request fails if one or both of the queues are deleted, or can't belong to a cluster.

Parameters:
addedQueue - queue added to the cluster
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

removeClusteredQueue

public void removeClusteredQueue(Queue removedQueue)
                          throws java.net.ConnectException,
                                 AdminException
Removes a queue from the cluster this queue belongs to.

The request fails if the queue does not exist or is not part of any cluster.

Parameters:
removedQueue - queue removed from the cluster
Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

getQueueClusterElements

public java.lang.String[] getQueueClusterElements()
                                           throws java.net.ConnectException,
                                                  AdminException
Returns the reference of the queues that belong to the cluster.

Throws:
java.net.ConnectException - If the admin connection is closed or broken.
AdminException - If the request fails.

Joram ${version}

Copyright ? 2005 Scalagent - All rights reserved