com.ibm.mq.jms
Class MQXASession

java.lang.Object
  |
  +--com.ibm.mq.jms.MQSession
        |
        +--com.ibm.mq.jms.MQXASession
All Implemented Interfaces:
JMSAcknowledgePoint, JMSDestinationFactory, java.lang.Runnable, javax.jms.Session, javax.jms.XASession
Direct Known Subclasses:
MQXAQueueSession, MQXATopicSession

public class MQXASession
extends MQSession
implements javax.jms.XASession

WebSphere MQ JMS exposes its JTS support in the XAConnectionFactory, XAConnection, and XASession classes. These classes are provided for use in a J2EE application server environment.

WebSphere Application Server Version 5 uses these classes to create and manage a pool of XAConnection and XASession objects. A JMS application does not need to use these classes directly if it is running in this environment.

A JMS application might need to use the XASession class if it is running in a WebSphere Application Server environment with a version of WebSphere Application Server before Version 5.


Field Summary
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
     
Method Summary
 void close()
          Closes the session.
 void commit()
          Not to be called in this context.
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination)
          Call the underlying JMS session to create a Message Consumer
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector)
          Call the underlying JMS session to create a Message Consumer
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String messageSelector, boolean noLocal)
          Call the underlying JMS session to create a Message Consumer
 javax.jms.MessageProducer createProducer(javax.jms.Destination destination)
          Call the underlying JMS session to create a Message Producer A client uses a MessageProducer object to send messages to a destination.
 javax.jms.Session getSession()
          Gets the session associated with this XASession.
 boolean getTransacted()
          Indicates that XA sessions are always transacted.
 javax.transaction.xa.XAResource getXAResource()
          Gets the XA resource.
 void recover()
          Not to be called in this context.
 void rollback()
          Not to be called in this context.
 
Methods inherited from class com.ibm.mq.jms.MQSession
createBrowser, createBrowser, createBytesMessage, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, setMessageListener, unsubscribe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.Session
createBrowser, createBrowser, createBytesMessage, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, run, setMessageListener, unsubscribe
 

Method Detail

getXAResource

public javax.transaction.xa.XAResource getXAResource()
Gets the XA resource.

Specified by:
getXAResource in interface javax.jms.XASession
Returns:
the XAResource

getTransacted

public boolean getTransacted()
                      throws javax.jms.JMSException
Indicates that XA sessions are always transacted.

Specified by:
getTransacted in interface javax.jms.XASession
Overrides:
getTransacted in class MQSession
Returns:
true; always in transacted mode.
Throws:
JMSException, - for reasons of inheritance.
javax.jms.JMSException - with one of the following reasons:

close

public final void close()
                 throws javax.jms.JMSException
Closes the session.

Specified by:
close in interface javax.jms.Session
Overrides:
close in class MQSession
Throws:
javax.jms.JMSException - if the Session could not be closed due to an internal error.

commit

public void commit()
            throws javax.jms.JMSException
Not to be called in this context.

Specified by:
commit in interface javax.jms.XASession
Overrides:
commit in class MQSession
Throws:
javax.jms.TransactionInProgressException - always.
javax.jms.JMSException - with one of the following reasons:

rollback

public void rollback()
              throws javax.jms.JMSException
Not to be called in this context.

Specified by:
rollback in interface javax.jms.XASession
Overrides:
rollback in class MQSession
Throws:
javax.jms.TransactionInProgressException - always.
javax.jms.JMSException - with one of the following reasons:

recover

public void recover()
             throws javax.jms.JMSException
Not to be called in this context.

Specified by:
recover in interface javax.jms.Session
Overrides:
recover in class MQSession
Throws:
javax.jms.IllegalStateException - always.
javax.jms.JMSException - with one of the following reasons:

getSession

public javax.jms.Session getSession()
                             throws javax.jms.JMSException
Gets the session associated with this XASession.

Specified by:
getSession in interface javax.jms.XASession
Returns:
the session object.
Throws:
javax.jms.JMSException - never

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination)
                                         throws javax.jms.JMSException
Call the underlying JMS session to create a Message Consumer

Specified by:
createConsumer in interface javax.jms.Session
Overrides:
createConsumer in class MQSession
Parameters:
destination - the Destination to access.
Returns:
the message consumer
Throws:
javax.jms.JMSException - if the command fails due to some internal JMS error.

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
                                                java.lang.String messageSelector)
                                         throws javax.jms.JMSException
Call the underlying JMS session to create a Message Consumer

Specified by:
createConsumer in interface javax.jms.Session
Overrides:
createConsumer in class MQSession
Parameters:
destination - the Destination to access.
messageSelector - the message selector
Returns:
the message consumer.
Throws:
javax.jms.JMSException - if the command fails due to some internal JMS error.

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
                                                java.lang.String messageSelector,
                                                boolean noLocal)
                                         throws javax.jms.JMSException
Call the underlying JMS session to create a Message Consumer

Specified by:
createConsumer in interface javax.jms.Session
Overrides:
createConsumer in class MQSession
Parameters:
destination - the Destination to access.
messageSelector - the message selector
noLocal - when the destination is a topic, true inhibits the delivery of messages published by its own connection. The behavior for NoLocal is ignored if the destination is a queue.
Returns:
MessageConsumer
Throws:
javax.jms.JMSException - with linked exception to whatever createQConsumer, createTConsumer and addConsumer throw.

createProducer

public javax.jms.MessageProducer createProducer(javax.jms.Destination destination)
                                         throws javax.jms.JMSException
Call the underlying JMS session to create a Message Producer

A client uses a MessageProducer object to send messages to a destination. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageProducer object.

Specified by:
createProducer in interface javax.jms.Session
Overrides:
createProducer in class MQSession
Parameters:
destination - - the Destination to send to, or null if this is a producer which does not have a specified destination.
Throws:
javax.jms.JMSException - - if the session fails to create a MessageProducer due to some internal error.

(c) Copyright IBM Corp. 2005. All Rights Reserved.