Package org.jboss.narayana.jta.jms
Class ConnectionProxy
java.lang.Object
org.jboss.narayana.jta.jms.ConnectionProxy
- All Implemented Interfaces:
jakarta.jms.Connection
,AutoCloseable
Proxy connection to wrap around provided
XAConnection
.- Author:
- Gytis Trikleris
-
Constructor Summary
ConstructorDescriptionConnectionProxy
(jakarta.jms.XAConnection xaConnection, TransactionHelper transactionHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Simply close the proxied connection if there is no active transaction.jakarta.jms.ConnectionConsumer
createConnectionConsumer
(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Delegate toxaConnection
jakarta.jms.ConnectionConsumer
createDurableConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Delegate toxaConnection
.jakarta.jms.Session
jakarta.jms.Session
createSession
(boolean transacted, int acknowledgeMode) Simply create a session with an XA connection if there is no active transaction.jakarta.jms.Session
createSession
(int sessionMode) jakarta.jms.ConnectionConsumer
createSharedConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) jakarta.jms.ConnectionConsumer
createSharedDurableConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Delegate toxaConnection
jakarta.jms.ExceptionListener
Delegate toxaConnection
jakarta.jms.ConnectionMetaData
Delegate toxaConnection
void
setClientID
(String clientID) void
setExceptionListener
(jakarta.jms.ExceptionListener listener) Delegate toxaConnection
void
start()
Delegate toxaConnection
void
stop()
Delegate toxaConnection
-
Constructor Details
-
ConnectionProxy
- Parameters:
xaConnection
- XA connection which needs to be proxied.transactionHelper
- utility to make transaction resources registration easier.
-
-
Method Details
-
createSession
public jakarta.jms.Session createSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSException Simply create a session with an XA connection if there is no active transaction. Or create a proxied session and register it with an active transaction.- Specified by:
createSession
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
createSession
public jakarta.jms.Session createSession(int sessionMode) throws jakarta.jms.JMSException - Specified by:
createSession
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
-
createSession
public jakarta.jms.Session createSession() throws jakarta.jms.JMSException- Specified by:
createSession
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
-
close
public void close() throws jakarta.jms.JMSExceptionSimply close the proxied connection if there is no active transaction. Or register aConnectionClosingSynchronization
if active transaction exists.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- if transaction service has failed (in unexpected way) to obtain transaction status, or if synchronization registration, or connection closing has failed.
-
getClientID
Delegate toxaConnection
- Specified by:
getClientID
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
setClientID
- Specified by:
setClientID
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
getMetaData
public jakarta.jms.ConnectionMetaData getMetaData() throws jakarta.jms.JMSExceptionDelegate toxaConnection
- Specified by:
getMetaData
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
getExceptionListener
public jakarta.jms.ExceptionListener getExceptionListener() throws jakarta.jms.JMSExceptionDelegate toxaConnection
- Specified by:
getExceptionListener
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
setExceptionListener
public void setExceptionListener(jakarta.jms.ExceptionListener listener) throws jakarta.jms.JMSException Delegate toxaConnection
- Specified by:
setExceptionListener
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
start
public void start() throws jakarta.jms.JMSExceptionDelegate toxaConnection
- Specified by:
start
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
stop
public void stop() throws jakarta.jms.JMSExceptionDelegate toxaConnection
- Specified by:
stop
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Delegate toxaConnection
- Specified by:
createConnectionConsumer
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-
createDurableConnectionConsumer
public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Delegate toxaConnection
.- Specified by:
createDurableConnectionConsumer
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- See Also:
-