Package org.jboss.narayana.jta.jms
Class ConnectionProxy
- java.lang.Object
-
- org.jboss.narayana.jta.jms.ConnectionProxy
-
- All Implemented Interfaces:
java.lang.AutoCloseable,javax.jms.Connection
public class ConnectionProxy extends java.lang.Object implements javax.jms.ConnectionProxy connection to wrap around providedXAConnection.- Author:
- Gytis Trikleris
-
-
Constructor Summary
Constructors Constructor Description ConnectionProxy(javax.jms.XAConnection xaConnection, TransactionHelper transactionHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Simply close the proxied connection if there is no active transaction.javax.jms.ConnectionConsumercreateConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)Delegate toxaConnectionjavax.jms.ConnectionConsumercreateDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)Delegate toxaConnection.javax.jms.SessioncreateSession()javax.jms.SessioncreateSession(boolean transacted, int acknowledgeMode)Simply create a session with an XA connection if there is no active transaction.javax.jms.SessioncreateSession(int sessionMode)javax.jms.ConnectionConsumercreateSharedConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)javax.jms.ConnectionConsumercreateSharedDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)java.lang.StringgetClientID()Delegate toxaConnectionjavax.jms.ExceptionListenergetExceptionListener()Delegate toxaConnectionjavax.jms.ConnectionMetaDatagetMetaData()Delegate toxaConnectionvoidsetClientID(java.lang.String clientID)voidsetExceptionListener(javax.jms.ExceptionListener listener)Delegate toxaConnectionvoidstart()Delegate toxaConnectionvoidstop()Delegate toxaConnection
-
-
-
Constructor Detail
-
ConnectionProxy
public ConnectionProxy(javax.jms.XAConnection xaConnection, TransactionHelper transactionHelper)- Parameters:
xaConnection- XA connection which needs to be proxied.transactionHelper- utility to make transaction resources registration easier.
-
-
Method Detail
-
createSession
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSExceptionSimply 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:
createSessionin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
SessionProxy,Connection.createSession(boolean, int)
-
createSession
public javax.jms.Session createSession(int sessionMode) throws javax.jms.JMSException- Specified by:
createSessionin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException
-
createSession
public javax.jms.Session createSession() throws javax.jms.JMSException- Specified by:
createSessionin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException
-
close
public void close() throws javax.jms.JMSExceptionSimply close the proxied connection if there is no active transaction. Or register aConnectionClosingSynchronizationif active transaction exists.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- if transaction service has failed (in unexpected way) to obtain transaction status, or if synchronization registration, or connection closing has failed.
-
getClientID
public java.lang.String getClientID() throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
getClientIDin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.getClientID()
-
setClientID
public void setClientID(java.lang.String clientID) throws javax.jms.JMSException- Specified by:
setClientIDin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.setClientID(String)
-
getMetaData
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
getMetaDatain interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.getMetaData()
-
getExceptionListener
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
getExceptionListenerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.getExceptionListener()
-
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
setExceptionListenerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.setExceptionListener(ExceptionListener)
-
start
public void start() throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
startin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.start()
-
stop
public void stop() throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
stopin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.stop()
-
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSExceptionDelegate toxaConnection- Specified by:
createConnectionConsumerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.createConnectionConsumer(Destination, String, ServerSessionPool, int)
-
createSharedConnectionConsumer
public javax.jms.ConnectionConsumer createSharedConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException- Specified by:
createSharedConnectionConsumerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException
-
createDurableConnectionConsumer
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSExceptionDelegate toxaConnection.- Specified by:
createDurableConnectionConsumerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException- See Also:
Connection.createDurableConnectionConsumer(Topic, String, String, ServerSessionPool, int)
-
createSharedDurableConnectionConsumer
public javax.jms.ConnectionConsumer createSharedDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException- Specified by:
createSharedDurableConnectionConsumerin interfacejavax.jms.Connection- Throws:
javax.jms.JMSException
-
-