org.apache.activemq
Class ActiveMQXAConnection

java.lang.Object
  extended by org.apache.activemq.ActiveMQConnection
      extended by org.apache.activemq.ActiveMQXAConnection
All Implemented Interfaces:
javax.jms.Connection, javax.jms.QueueConnection, javax.jms.TopicConnection, javax.jms.XAConnection, javax.jms.XAQueueConnection, javax.jms.XATopicConnection, Closeable, StatsCapable, StreamConnection, TransportListener

public class ActiveMQXAConnection
extends ActiveMQConnection
implements javax.jms.XATopicConnection, javax.jms.XAQueueConnection, javax.jms.XAConnection

The XAConnection interface extends the capability of Connection by providing an XASession (optional).

The XAConnection interface is optional. JMS providers are not required to support this interface. This interface is for use by JMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Version:
$Revision: 1.6 $
See Also:
Connection, ConnectionFactory, QueueConnection, TopicConnection, TopicConnectionFactory, QueueConnection, QueueConnectionFactory

Field Summary
 
Fields inherited from class org.apache.activemq.ActiveMQConnection
alwaysSessionAsync, DEFAULT_BROKER_URL, DEFAULT_PASSWORD, DEFAULT_USER, dispatchAsync
 
Constructor Summary
protected ActiveMQXAConnection(Transport transport, IdGenerator clientIdGenerator, JMSStatsImpl factoryStats)
           
 
Method Summary
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
          Creates a Session object.
 javax.jms.XAQueueSession createXAQueueSession()
           
 javax.jms.XASession createXASession()
           
 javax.jms.XATopicSession createXATopicSession()
           
 
Methods inherited from class org.apache.activemq.ActiveMQConnection
addConnectionConsumer, addDispatcher, addInputStream, addOutputStream, addSession, addTransportListener, asyncSendPacket, changeUserInfo, checkClientIDWasManuallySpecified, checkClosed, checkClosedOrFailed, cleanup, close, createConnectionConsumer, createConnectionConsumer, createConnectionConsumer, createConnectionConsumer, createDurableConnectionConsumer, createDurableConnectionConsumer, createDurableInputStream, createDurableInputStream, createDurableInputStream, createInputStream, createInputStream, createInputStream, createNonPersistentOutputStream, createOutputStream, createOutputStream, createQueueSession, createTempDestination, createTopicSession, deleteTempDestination, destroyDestination, ensureConnectionInfoSent, getBrokerInfo, getBrokerName, getClientID, getCloseTimeout, getConnectionInfo, getConnectionStats, getExceptionListener, getInitializedClientID, getLocalTransactionIdGenerator, getMetaData, getNextSessionId, getPrefetchPolicy, getRedeliveryPolicy, getResourceManagerId, getSessionTaskRunner, getStats, getTransportChannel, isAlwaysSessionAsync, isClosed, isClosing, isCopyMessageOnSend, isDeleted, isDisableTimeStampsByDefault, isDispatchAsync, isNestedMapAndListEnabled, isObjectMessageSerializationDefered, isOptimizeAcknowledge, isOptimizedMessageDispatch, isStarted, isStatsEnabled, isTransportFailed, isUseAsyncSend, isUseCompression, isUseRetroactiveConsumer, isUseSyncSend, isWatchTopicAdvisories, makeConnection, makeConnection, makeConnection, onAsyncException, onCommand, onConnectionControl, onConsumerControl, onControlCommand, onException, removeConnectionConsumer, removeDispatcher, removeInputStream, removeOutputStream, removeSession, removeTransportListener, setAlwaysSessionAsync, setClientID, setCloseTimeout, setCopyMessageOnSend, setDefaultClientID, setDisableTimeStampsByDefault, setDispatchAsync, setExceptionListener, setNestedMapAndListEnabled, setObjectMessageSerializationDefered, setOptimizeAcknowledge, setOptimizedMessageDispatch, setPassword, setPrefetchPolicy, setRedeliveryPolicy, setSessionTaskRunner, setStatsEnabled, setUseAsyncSend, setUseCompression, setUseRetroactiveConsumer, setUserName, setUseSyncSend, setWatchTopicAdvisories, start, stop, syncSendPacket, syncSendPacket, toString, transportFailed, transportInterupted, transportResumed, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.XATopicConnection
createTopicSession
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 
Methods inherited from interface javax.jms.TopicConnection
createConnectionConsumer, createDurableConnectionConsumer
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 
Methods inherited from interface javax.jms.XAQueueConnection
createQueueSession
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 
Methods inherited from interface javax.jms.QueueConnection
createConnectionConsumer
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 

Constructor Detail

ActiveMQXAConnection

protected ActiveMQXAConnection(Transport transport,
                               IdGenerator clientIdGenerator,
                               JMSStatsImpl factoryStats)
                        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

createXASession

public javax.jms.XASession createXASession()
                                    throws javax.jms.JMSException
Specified by:
createXASession in interface javax.jms.XAConnection
Throws:
javax.jms.JMSException

createXATopicSession

public javax.jms.XATopicSession createXATopicSession()
                                              throws javax.jms.JMSException
Specified by:
createXATopicSession in interface javax.jms.XATopicConnection
Throws:
javax.jms.JMSException

createXAQueueSession

public javax.jms.XAQueueSession createXAQueueSession()
                                              throws javax.jms.JMSException
Specified by:
createXAQueueSession in interface javax.jms.XAQueueConnection
Throws:
javax.jms.JMSException

createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws javax.jms.JMSException
Description copied from class: ActiveMQConnection
Creates a Session object.

Specified by:
createSession in interface javax.jms.Connection
Specified by:
createSession in interface javax.jms.XAConnection
Overrides:
createSession in class ActiveMQConnection
Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
Returns:
a newly created session
Throws:
javax.jms.JMSException - if the Connection object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
See Also:
Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE


Copyright © 2010 Apache Software Foundation. All Rights Reserved.