Websphere MQ Everyplace

com.ibm.mqe.jms
Class MQeJMSQueue

java.lang.Object
  |
  +--com.ibm.mqe.jms.MQeDestination
        |
        +--com.ibm.mqe.jms.MQeJMSQueue
All Implemented Interfaces:
javax.jms.Destination, javax.jms.Queue
Direct Known Subclasses:
MQeJMSJNDIQueue, MQeTemporaryQueue

public class MQeJMSQueue
extends MQeDestination
implements javax.jms.Queue

A Queue object encapsulates a provider-specific queue name. It is the way a client specifies the identity of queue to JMS methods.

WebSphere MQ Everplace JMS queues are named using a combination of the MQ Everyplace queue manager name, a plus sign and the name of the MQ Everyplace queue, for example

ServerQM+testQ

However, if the queue is local then the queue manager name and plus sign may be omitted and the queue name can be used on its own. When referring to local queues, the short form

SYSTEM.DEFAULT.LOCAL.QUEUE

and long forms

LocalQM+SYSTEM.DEFAULT.LOCAL.QUEUE

are equivalent. When querying Queue names (e.g. getQueueName() the name is always returned in this format. However, for convenience Constructors are provided taking either a single String in this format or a pair of strings containing the Queue Manager and Queue names which are converted internally to a MQ Everyplace JMS queue name. As is usual with MQ Everyplace a null value for the Queue Manager name is interpreted as a reference to the local Queue Manager.

Note that a MQeJMSQueue object cannot be stored and retrieved using JNDI - this allows this class to be used on small devices where lookup of JNDI administered objects is either impractical or represents unnecessary overhead. MQeJMSJNDIQueue extends this class to include support for JNDI.

More information on configuring an MQeJMSQueue can be found in Chapter 10 of the WebSphere MQ Everyplace Application Programming Guide.


Constructor Summary
MQeJMSQueue()
          A default constructor for use by the MQeJMSQueueFactory and the JMS Administration tool.
MQeJMSQueue(java.lang.String jmsQueueName)
          Create a new instance of an MQeJMSQueue.
MQeJMSQueue(java.lang.String mqeQMgrName, java.lang.String mqeQueueName)
          Create a new instance of an MQeJMSQueue.
 
Method Summary
 boolean getMQNative()
          This method returns true if this destination corresponds to a native WebSphere MQ queue.
 java.lang.String getQueueName()
          Get the name of this queue.
 void setMQNative(boolean isMQNative)
          If MQNative is set to true, then JMS messages sent to this destination will be converted to an MQeMQMsgObject suitable for traditional non-JMS WebSphere MQ applications.
 java.lang.String toString()
          Return a formatted version of the queue name.
 
Methods inherited from class com.ibm.mqe.jms.MQeDestination
getDescription, setDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MQeJMSQueue

public MQeJMSQueue()
A default constructor for use by the MQeJMSQueueFactory and the JMS Administration tool. This is not intended for use by applications.


MQeJMSQueue

public MQeJMSQueue(java.lang.String jmsQueueName)
            throws javax.jms.JMSException
Create a new instance of an MQeJMSQueue.

Parameters:
jmsQueueName - The name of the JMS Queue.
Throws:
javax.jms.InvalidDestinationException - if the JMS queue name is invalid
javax.jms.JMSException

MQeJMSQueue

public MQeJMSQueue(java.lang.String mqeQMgrName,
                   java.lang.String mqeQueueName)
            throws javax.jms.JMSException
Create a new instance of an MQeJMSQueue.

Parameters:
mqeQMgrName - The name of the associated MQe Queue Manager. If this is null then the local queue manager is used.
mqeQueueName - The name of the associated MQe Queue
Throws:
javax.jms.InvalidDestinationException - if the MQe queue name is invalid
javax.jms.JMSException
Method Detail

getQueueName

public java.lang.String getQueueName()
                              throws javax.jms.JMSException
Get the name of this queue.

Note that the naming convention used here is specific to WebSphere MQ Everyplace JMS, and applications that depend upon the format of the returned String are not portable.

Specified by:
getQueueName in interface javax.jms.Queue
Returns:
the name of the MQeJMSQueue
Throws:
javax.jms.JMSException - if JMS implementation for Queue fails to to return queue name due to some internal error.

toString

public java.lang.String toString()
Return a formatted version of the queue name.

Specified by:
toString in interface javax.jms.Queue
Overrides:
toString in class java.lang.Object
Returns:
the provider-specific identity values for this queue.

setMQNative

public void setMQNative(boolean isMQNative)
If MQNative is set to true, then JMS messages sent to this destination will be converted to an MQeMQMsgObject suitable for traditional non-JMS WebSphere MQ applications. This convertion requires some information to be discarded - see Chapter 12 of the WebSphere MQ "Using Java" book for more information on this conversion.

MQNative is set to false by default.

Note that MQNative should be false if this message is going to a WebSphere MQ JMS application.


getMQNative

public boolean getMQNative()
This method returns true if this destination corresponds to a native WebSphere MQ queue. Messages received from this destination will be converted from an MQeMQMsgObject to a JMS message.

Returns:
boolean does this destination corresponds to a native MQ queue

Websphere MQ Everyplace