org.apache.qpid.client
Class XASessionImpl

java.lang.Object
  extended by org.apache.qpid.client.Closeable
      extended by org.apache.qpid.client.AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
          extended by org.apache.qpid.client.AMQSession_0_10
              extended by org.apache.qpid.client.XASessionImpl
All Implemented Interfaces:
Runnable, QueueSession, Session, TopicSession, XAQueueSession, XASession, XATopicSession, org.apache.qpid.transport.SessionListener

public class XASessionImpl
extends AMQSession_0_10
implements XASession, XATopicSession, XAQueueSession

This is an implementation of the javax.njms.XASEssion interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.client.AMQSession
AMQSession.Dispatchable, AMQSession.Dispatcher, AMQSession.IdToConsumerMap<C extends BasicMessageConsumer>
 
Field Summary
 
Fields inherited from class org.apache.qpid.client.AMQSession_0_10
_qpidConnection
 
Fields inherited from class org.apache.qpid.client.AMQSession
_acknowledgeMode, _channelId, _connection, _consumers, _deliveredMessageTags, _dispatcher, _dispatcherThread, _firstDispatcher, _immediatePrefetch, _messageFactoryRegistry, _queue, _reverseSubscriptionMap, _strictAMQP, _strictAMQPFATAL, _subscriberAccess, _subscriberDetails, _subscriptions, _thisSession, _transacted, _unacknowledgedMessageTags, DECLARE_EXCHANGES, DECLARE_QUEUES, DEFAULT_FLOW_CONTROL_WAIT_FAILURE, DEFAULT_IMMEDIATE, DEFAULT_MANDATORY, DEFAULT_WAIT_ON_SEND, FLOW_CONTROL_WAIT_FAILURE, FLOW_CONTROL_WAIT_PERIOD, IMMEDIATE_PREFETCH, IMMEDIATE_PREFETCH_DEFAULT, STRICT_AMQP, STRICT_AMQP_DEFAULT, STRICT_AMQP_FATAL, STRICT_AMQP_FATAL_DEFAULT, USE_AMQP_ENCODED_MAP_MESSAGE
 
Fields inherited from class org.apache.qpid.client.Closeable
_closed, _closing
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Fields inherited from interface org.apache.qpid.jms.Session
NO_ACKNOWLEDGE, PRE_ACKNOWLEDGE
 
Constructor Summary
XASessionImpl(org.apache.qpid.transport.Connection qpidConnection, AMQConnection con, int channelId, int defaultPrefetchHigh, int defaultPrefetchLow)
          Create a JMS XASession
 
Method Summary
 void commit()
          Throws a TransactionInProgressException, since it should not be called for an XASession object.
 void createSession()
          Create a qpid session.
protected  org.apache.qpid.transport.Session getQpidSession()
          Access to the underlying Qpid Session
 QueueSession getQueueSession()
          Gets the topic session associated with this XATopicSession.
 Session getSession()
          Gets the session associated with this XASession.
 TopicSession getTopicSession()
          Gets the topic session associated with this XATopicSession.
 XAResource getXAResource()
          Returns an XA resource.
 void rollback()
          Throws a TransactionInProgressException, since it should not be called for an XASession object.
 
Methods inherited from class org.apache.qpid.client.AMQSession_0_10
acknowledgeMessage, addDeliveredMessage, closed, createMessageConsumer, createMessageProducer, declareQueue, exception, failoverPrep, flushAcknowledgments, flushAcknowledgments, getCurrentException, getMessageDelegateFactory, handleAddressBasedDestination, isExchangeExist, isQueueBound, isQueueBound, isQueueBound, isQueueBound, isQueueExist, message, messageAcknowledge, messageAcknowledge, opened, rejectMessage, releaseForRollback, requestQueueDepth, resolveAddressType, resumed, send0_10QueueDeclare, sendClose, sendCommit, sendConsume, sendCreateQueue, sendExchangeDeclare, sendExchangeDeclare, sendQueueBind, sendQueueDeclare, sendQueueDelete, sendRecover, sendRollback, sendSuspendChannel, setCurrentException, setLegacyFiledsForQueueType, setLegacyFiledsForTopicType, sync, tagLE, updateRollbackMark
 
Methods inherited from class org.apache.qpid.client.AMQSession
acknowledge, addBindingKey, addUnacknowledgedMessage, bindQueue, bindQueue, checkFlowControl, checkNotClosed, checkTransacted, checkValidTopic, checkValidTopic, close, close, closed, confirmConsumerCancelled, createBrowser, createBrowser, createBrowserConsumer, createBytesMessage, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumer, createConsumerImpl, createDurableSubscriber, createDurableSubscriber, createExclusiveConsumer, createExclusiveConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createProducer, createProducer, createProducer, createPublisher, createQueue, createQueue, createQueue, createQueueReceiver, createQueueReceiver, createReceiver, createReceiver, createSender, createStreamMessage, createSubscriber, createSubscriber, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, declareAndBind, declareExchange, declareQueue, deleteQueue, deregisterConsumer, deregisterProducer, dispatch, getAcknowledgeMode, getAMQConnection, getChannelId, getDefaultPrefetch, getDefaultPrefetchHigh, getDefaultPrefetchLow, getDefaultQueueExchangeName, getDefaultTopicExchangeName, getFailoverMutex, getMessageDeliveryLock, getMessageListener, getMethodRegistry, getProtocolHandler, getProtocolMajorVersion, getProtocolMinorVersion, getQueueDepth, getTemporaryQueueExchangeName, getTemporaryTopicExchangeName, getTicket, getTransacted, hasConsumer, hasFailedOver, hasMessageListeners, isClosed, isClosing, isDirty, isInRecovery, isQueueBound, isStarted, isStrictAMQP, isSuspended, markClean, markClosed, markDirty, messageReceived, prefetch, recover, rejectMessage, rejectMessage, resubscribe, run, setFlowControl, setHasMessageListeners, setInRecovery, setMessageListener, setTicket, start, startDispatcherIfNecessary, startDispatcherIfNecessary, stop, suspendChannel, syncDispatchQueue, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.XASession
getTransacted
 
Methods inherited from interface javax.jms.Session
close, createBrowser, createBrowser, createBytesMessage, createConsumer, createConsumer, createConsumer, createDurableSubscriber, createDurableSubscriber, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createQueue, createStreamMessage, createTemporaryQueue, createTemporaryTopic, createTextMessage, createTextMessage, createTopic, getAcknowledgeMode, getMessageListener, recover, run, setMessageListener, unsubscribe
 

Constructor Detail

XASessionImpl

public XASessionImpl(org.apache.qpid.transport.Connection qpidConnection,
                     AMQConnection con,
                     int channelId,
                     int defaultPrefetchHigh,
                     int defaultPrefetchLow)
Create a JMS XASession

Method Detail

createSession

public void createSession()
Create a qpid session.


getSession

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

Specified by:
getSession in interface XASession
Returns:
The session object.
Throws:
JMSException - if an internal error occurs.

getXAResource

public XAResource getXAResource()
Returns an XA resource.

Specified by:
getXAResource in interface XASession
Returns:
An XA resource.

commit

public void commit()
            throws JMSException
Throws a TransactionInProgressException, since it should not be called for an XASession object.

Specified by:
commit in interface Session
Specified by:
commit in interface XASession
Overrides:
commit in class AMQSession_0_10
Throws:
TransactionInProgressException - always.
JMSException - If the JMS provider fails to commit the transaction due to some internal error. This does not mean that the commit is known to have failed, merely that it is not known whether it failed or not.

rollback

public void rollback()
              throws JMSException
Throws a TransactionInProgressException, since it should not be called for an XASession object.

Specified by:
rollback in interface Session
Specified by:
rollback in interface XASession
Overrides:
rollback in class AMQSession<BasicMessageConsumer_0_10,BasicMessageProducer_0_10>
Throws:
TransactionInProgressException - always.
JMSException - If the JMS provider fails to rollback the transaction due to some internal error. This does not mean that the rollback is known to have failed, merely that it is not known whether it failed or not.

getQpidSession

protected org.apache.qpid.transport.Session getQpidSession()
Access to the underlying Qpid Session

Overrides:
getQpidSession in class AMQSession_0_10
Returns:
The associated Qpid Session.

getQueueSession

public QueueSession getQueueSession()
                             throws JMSException
Gets the topic session associated with this XATopicSession.

Specified by:
getQueueSession in interface XAQueueSession
Returns:
the topic session object
Throws:
JMSException - If an internal error occurs.

getTopicSession

public TopicSession getTopicSession()
                             throws JMSException
Gets the topic session associated with this XATopicSession.

Specified by:
getTopicSession in interface XATopicSession
Returns:
the topic session object
Throws:
JMSException - If an internal error occurs.


Licensed to the Apache Software Foundation