Package org.jboss.narayana.jta.jms
Class SessionProxy
java.lang.Object
org.jboss.narayana.jta.jms.SessionProxy
- All Implemented Interfaces:
jakarta.jms.Session
,AutoCloseable
,Runnable
Proxy session to wrap around provided
XASession
.- Author:
- Gytis Trikleris
-
Field Summary
Fields inherited from interface jakarta.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
-
Constructor Summary
ConstructorDescriptionSessionProxy
(jakarta.jms.XASession xaSession, TransactionHelper transactionHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Simply close proxied session if there is no active transaction.void
commit()
jakarta.jms.QueueBrowser
createBrowser
(jakarta.jms.Queue queue) jakarta.jms.QueueBrowser
createBrowser
(jakarta.jms.Queue queue, String s) jakarta.jms.BytesMessage
jakarta.jms.MessageConsumer
createConsumer
(jakarta.jms.Destination destination) jakarta.jms.MessageConsumer
createConsumer
(jakarta.jms.Destination destination, String s) jakarta.jms.MessageConsumer
createConsumer
(jakarta.jms.Destination destination, String s, boolean b) jakarta.jms.MessageConsumer
createDurableConsumer
(jakarta.jms.Topic topic, String name) jakarta.jms.MessageConsumer
createDurableConsumer
(jakarta.jms.Topic topic, String name, String messageSelector, boolean noLocal) jakarta.jms.TopicSubscriber
createDurableSubscriber
(jakarta.jms.Topic topic, String s) jakarta.jms.TopicSubscriber
createDurableSubscriber
(jakarta.jms.Topic topic, String s, String s1, boolean b) jakarta.jms.MapMessage
jakarta.jms.Message
jakarta.jms.ObjectMessage
jakarta.jms.ObjectMessage
createObjectMessage
(Serializable serializable) jakarta.jms.MessageProducer
createProducer
(jakarta.jms.Destination destination) jakarta.jms.Queue
jakarta.jms.MessageConsumer
createSharedConsumer
(jakarta.jms.Topic topic, String sharedSubscriptionName) jakarta.jms.MessageConsumer
createSharedConsumer
(jakarta.jms.Topic topic, String sharedSubscriptionName, String messageSelector) jakarta.jms.MessageConsumer
createSharedDurableConsumer
(jakarta.jms.Topic topic, String name) jakarta.jms.MessageConsumer
createSharedDurableConsumer
(jakarta.jms.Topic topic, String name, String messageSelector) jakarta.jms.StreamMessage
jakarta.jms.TemporaryQueue
jakarta.jms.TemporaryTopic
jakarta.jms.TextMessage
jakarta.jms.TextMessage
jakarta.jms.Topic
int
jakarta.jms.MessageListener
boolean
void
recover()
void
rollback()
void
run()
void
setMessageListener
(jakarta.jms.MessageListener messageListener) void
-
Constructor Details
-
SessionProxy
- Parameters:
xaSession
- XA session that needs to be proxied.transactionHelper
- utility to make transaction resources registration easier.
-
-
Method Details
-
close
public void close() throws jakarta.jms.JMSExceptionSimply close proxied session if there is no active transaction. Or if transaction exists, delist session's XA resource and register aSessionClosingSynchronization
to close the proxied session.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createBytesMessage
public jakarta.jms.BytesMessage createBytesMessage() throws jakarta.jms.JMSException- Specified by:
createBytesMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createMapMessage
public jakarta.jms.MapMessage createMapMessage() throws jakarta.jms.JMSException- Specified by:
createMapMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createMessage
public jakarta.jms.Message createMessage() throws jakarta.jms.JMSException- Specified by:
createMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createObjectMessage
public jakarta.jms.ObjectMessage createObjectMessage() throws jakarta.jms.JMSException- Specified by:
createObjectMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createObjectMessage
public jakarta.jms.ObjectMessage createObjectMessage(Serializable serializable) throws jakarta.jms.JMSException - Specified by:
createObjectMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createStreamMessage
public jakarta.jms.StreamMessage createStreamMessage() throws jakarta.jms.JMSException- Specified by:
createStreamMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createTextMessage
public jakarta.jms.TextMessage createTextMessage() throws jakarta.jms.JMSException- Specified by:
createTextMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createTextMessage
- Specified by:
createTextMessage
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
getTransacted
public boolean getTransacted() throws jakarta.jms.JMSException- Specified by:
getTransacted
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
getAcknowledgeMode
public int getAcknowledgeMode() throws jakarta.jms.JMSException- Specified by:
getAcknowledgeMode
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
commit
public void commit() throws jakarta.jms.JMSException- Specified by:
commit
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
rollback
public void rollback() throws jakarta.jms.JMSException- Specified by:
rollback
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
recover
public void recover() throws jakarta.jms.JMSException- Specified by:
recover
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
getMessageListener
public jakarta.jms.MessageListener getMessageListener() throws jakarta.jms.JMSException- Specified by:
getMessageListener
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
setMessageListener
public void setMessageListener(jakarta.jms.MessageListener messageListener) throws jakarta.jms.JMSException - Specified by:
setMessageListener
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
run
public void run() -
createProducer
public jakarta.jms.MessageProducer createProducer(jakarta.jms.Destination destination) throws jakarta.jms.JMSException - Specified by:
createProducer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination destination) throws jakarta.jms.JMSException - Specified by:
createConsumer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination destination, String s) throws jakarta.jms.JMSException - Specified by:
createConsumer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createConsumer
public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination destination, String s, boolean b) throws jakarta.jms.JMSException - Specified by:
createConsumer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createQueue
- Specified by:
createQueue
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createTopic
- Specified by:
createTopic
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createDurableSubscriber
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String s) throws jakarta.jms.JMSException - Specified by:
createDurableSubscriber
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createDurableSubscriber
public jakarta.jms.TopicSubscriber createDurableSubscriber(jakarta.jms.Topic topic, String s, String s1, boolean b) throws jakarta.jms.JMSException - Specified by:
createDurableSubscriber
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createDurableConsumer
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSException - Specified by:
createDurableConsumer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createDurableConsumer
public jakarta.jms.MessageConsumer createDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector, boolean noLocal) throws jakarta.jms.JMSException - Specified by:
createDurableConsumer
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createBrowser
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue) throws jakarta.jms.JMSException - Specified by:
createBrowser
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createBrowser
public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue, String s) throws jakarta.jms.JMSException - Specified by:
createBrowser
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createTemporaryQueue
public jakarta.jms.TemporaryQueue createTemporaryQueue() throws jakarta.jms.JMSException- Specified by:
createTemporaryQueue
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
createTemporaryTopic
public jakarta.jms.TemporaryTopic createTemporaryTopic() throws jakarta.jms.JMSException- Specified by:
createTemporaryTopic
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-
unsubscribe
- Specified by:
unsubscribe
in interfacejakarta.jms.Session
- Throws:
jakarta.jms.JMSException
-