Package org.apache.activemq
Class ActiveMQXAConnection
- java.lang.Object
-
- org.apache.activemq.ActiveMQConnection
-
- org.apache.activemq.ActiveMQXAConnection
-
- All Implemented Interfaces:
Connection
,QueueConnection
,TopicConnection
,XAConnection
,XAQueueConnection
,XATopicConnection
,Closeable
,EnhancedConnection
,StatsCapable
,TransportListener
public class ActiveMQXAConnection extends ActiveMQConnection implements XATopicConnection, XAQueueConnection, 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.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.ActiveMQConnection
activeTempDestinations, alwaysSessionAsync, DEFAULT_BROKER_URL, DEFAULT_PASSWORD, DEFAULT_THREAD_POOL_SIZE, DEFAULT_USER, dispatchAsync, transportInterruptionProcessingComplete
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ActiveMQXAConnection(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Session
createSession(boolean transacted, int acknowledgeMode)
Creates aSession
object.XAQueueSession
createXAQueueSession()
XASession
createXASession()
XATopicSession
createXATopicSession()
int
getXaAckMode()
void
setXaAckMode(int xaAckMode)
-
Methods inherited from class org.apache.activemq.ActiveMQConnection
addConnectionConsumer, addDispatcher, addProducer, addSession, addTransportListener, asyncSendPacket, changeUserInfo, checkClientIDWasManuallySpecified, checkClosed, checkClosedOrFailed, cleanup, cleanUpTempDestinations, close, createBlobTransferPolicy, createConnectionConsumer, createConnectionConsumer, createConnectionConsumer, createConnectionConsumer, createDurableConnectionConsumer, createDurableConnectionConsumer, createQueueSession, createTempDestination, createTopicSession, deleteTempDestination, destroyDestination, doCleanup, ensureConnectionInfoSent, getBlobTransferPolicy, getBrokerInfo, getBrokerName, getClientID, getClientInternalExceptionListener, getCloseTimeout, getConnectionInfo, getConnectionStats, getConnectResponseTimeout, getConsumerFailoverRedeliveryWaitPeriod, getDestinationSource, getExceptionListener, getExecutor, getFirstFailureError, getInitializedClientID, getLocalTransactionIdGenerator, getMaxThreadPoolSize, getMetaData, getNextSessionId, getOptimizeAcknowledgeTimeOut, getOptimizedAckScheduledAckInterval, getPrefetchPolicy, getProducerWindowSize, getProtocolVersion, getRedeliveryPolicy, getRedeliveryPolicyMap, getRejectedTaskHandler, getResourceManagerId, getScheduler, getSendTimeout, getSessions, getSessionTaskRunner, getStats, getTimeCreated, getTransformer, getTransport, getTransportChannel, getTrustedPackages, getWarnAboutUnstartedConnectionTimeout, hasDispatcher, isAlwaysSessionAsync, isAlwaysSyncSend, isCheckForDuplicates, isClosed, isClosing, isConsumerExpiryCheckEnabled, isCopyMessageOnSend, isDeleted, isDisableTimeStampsByDefault, isDispatchAsync, isDuplicate, isExclusiveConsumer, isMessagePrioritySupported, isNestedMapAndListEnabled, isNonBlockingRedelivery, isObjectMessageSerializationDefered, isOptimizeAcknowledge, isOptimizedMessageDispatch, isRmIdFromConnectionId, isSendAcksAsync, isStarted, isStatsEnabled, isTransactedIndividualAck, isTransportFailed, isTrustAllPackages, isUseAsyncSend, isUseCompression, isUseDedicatedTaskRunner, isUseRetroactiveConsumer, isUserSpecifiedClientID, isWatchTopicAdvisories, makeConnection, makeConnection, makeConnection, onAsyncException, onClientInternalException, onCommand, onConnectionControl, onConsumerControl, onException, onWireFormatInfo, removeConnectionConsumer, removeDispatcher, removeDispatcher, removeProducer, removeSession, removeTransportListener, rollbackDuplicate, setAlwaysSessionAsync, setAlwaysSyncSend, setAuditDepth, setAuditMaximumProducerNumber, setBlobTransferPolicy, setCheckForDuplicates, setClientID, setClientInternalExceptionListener, setCloseTimeout, setConnectResponseTimeout, setConsumerExpiryCheckEnabled, setConsumerFailoverRedeliveryWaitPeriod, setCopyMessageOnSend, setDefaultClientID, setDisableTimeStampsByDefault, setDispatchAsync, setExceptionListener, setExclusiveConsumer, setMaxThreadPoolSize, setMessagePrioritySupported, setNestedMapAndListEnabled, setNonBlockingRedelivery, setObjectMessageSerializationDefered, setOptimizeAcknowledge, setOptimizeAcknowledgeTimeOut, setOptimizedAckScheduledAckInterval, setOptimizedMessageDispatch, setPassword, setPrefetchPolicy, setProducerWindowSize, setRedeliveryPolicy, setRedeliveryPolicyMap, setRejectedTaskHandler, setRmIdFromConnectionId, setSendAcksAsync, setSendTimeout, setSessionTaskRunner, setStatsEnabled, setTransactedIndividualAck, setTransformer, setTrustAllPackages, setTrustedPackages, setUseAsyncSend, setUseCompression, setUseDedicatedTaskRunner, setUseRetroactiveConsumer, setUserName, setWarnAboutUnstartedConnectionTimeout, setWatchTopicAdvisories, start, stop, syncSendPacket, syncSendPacket, syncSendPacket, toString, transportFailed, transportInterruptionProcessingComplete, transportInterupted, transportResumed, unsubscribe, waitForTransportInterruptionProcessingToComplete
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.TopicConnection
createConnectionConsumer, createDurableConnectionConsumer
-
Methods inherited from interface javax.jms.XAQueueConnection
createQueueSession
-
Methods inherited from interface javax.jms.XATopicConnection
createTopicSession
-
-
-
-
Constructor Detail
-
ActiveMQXAConnection
protected ActiveMQXAConnection(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception
- Throws:
Exception
-
-
Method Detail
-
createXASession
public XASession createXASession() throws JMSException
- Specified by:
createXASession
in interfaceXAConnection
- Throws:
JMSException
-
createXATopicSession
public XATopicSession createXATopicSession() throws JMSException
- Specified by:
createXATopicSession
in interfaceXATopicConnection
- Throws:
JMSException
-
createXAQueueSession
public XAQueueSession createXAQueueSession() throws JMSException
- Specified by:
createXAQueueSession
in interfaceXAQueueConnection
- Throws:
JMSException
-
createSession
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
Description copied from class:ActiveMQConnection
Creates aSession
object.- Specified by:
createSession
in interfaceConnection
- Specified by:
createSession
in interfaceXAConnection
- Overrides:
createSession
in classActiveMQConnection
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created session
- Throws:
JMSException
- if theConnection
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
-
setXaAckMode
public void setXaAckMode(int xaAckMode)
-
getXaAckMode
public int getXaAckMode()
-
-