Class SessionProxy

java.lang.Object
org.jboss.narayana.jta.jms.SessionProxy
All Implemented Interfaces:
jakarta.jms.Session, AutoCloseable, Runnable

public class SessionProxy extends Object implements jakarta.jms.Session
Proxy session to wrap around provided XASession.
Author:
Gytis Trikleris
  • Constructor Details

    • SessionProxy

      public SessionProxy(jakarta.jms.XASession xaSession, TransactionHelper transactionHelper)
      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.JMSException
      Simply close proxied session if there is no active transaction. Or if transaction exists, delist session's XA resource and register a SessionClosingSynchronization to close the proxied session.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createBytesMessage

      public jakarta.jms.BytesMessage createBytesMessage() throws jakarta.jms.JMSException
      Specified by:
      createBytesMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createMapMessage

      public jakarta.jms.MapMessage createMapMessage() throws jakarta.jms.JMSException
      Specified by:
      createMapMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createMessage

      public jakarta.jms.Message createMessage() throws jakarta.jms.JMSException
      Specified by:
      createMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createObjectMessage

      public jakarta.jms.ObjectMessage createObjectMessage() throws jakarta.jms.JMSException
      Specified by:
      createObjectMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createObjectMessage

      public jakarta.jms.ObjectMessage createObjectMessage(Serializable serializable) throws jakarta.jms.JMSException
      Specified by:
      createObjectMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createStreamMessage

      public jakarta.jms.StreamMessage createStreamMessage() throws jakarta.jms.JMSException
      Specified by:
      createStreamMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createTextMessage

      public jakarta.jms.TextMessage createTextMessage() throws jakarta.jms.JMSException
      Specified by:
      createTextMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createTextMessage

      public jakarta.jms.TextMessage createTextMessage(String s) throws jakarta.jms.JMSException
      Specified by:
      createTextMessage in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • getTransacted

      public boolean getTransacted() throws jakarta.jms.JMSException
      Specified by:
      getTransacted in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • getAcknowledgeMode

      public int getAcknowledgeMode() throws jakarta.jms.JMSException
      Specified by:
      getAcknowledgeMode in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • commit

      public void commit() throws jakarta.jms.JMSException
      Specified by:
      commit in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • rollback

      public void rollback() throws jakarta.jms.JMSException
      Specified by:
      rollback in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • recover

      public void recover() throws jakarta.jms.JMSException
      Specified by:
      recover in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • getMessageListener

      public jakarta.jms.MessageListener getMessageListener() throws jakarta.jms.JMSException
      Specified by:
      getMessageListener in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • setMessageListener

      public void setMessageListener(jakarta.jms.MessageListener messageListener) throws jakarta.jms.JMSException
      Specified by:
      setMessageListener in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Specified by:
      run in interface jakarta.jms.Session
    • createProducer

      public jakarta.jms.MessageProducer createProducer(jakarta.jms.Destination destination) throws jakarta.jms.JMSException
      Specified by:
      createProducer in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createConsumer

      public jakarta.jms.MessageConsumer createConsumer(jakarta.jms.Destination destination) throws jakarta.jms.JMSException
      Specified by:
      createConsumer in interface jakarta.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 interface jakarta.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 interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createSharedConsumer

      public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName) throws jakarta.jms.JMSException
      Specified by:
      createSharedConsumer in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createSharedConsumer

      public jakarta.jms.MessageConsumer createSharedConsumer(jakarta.jms.Topic topic, String sharedSubscriptionName, String messageSelector) throws jakarta.jms.JMSException
      Specified by:
      createSharedConsumer in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createQueue

      public jakarta.jms.Queue createQueue(String s) throws jakarta.jms.JMSException
      Specified by:
      createQueue in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createTopic

      public jakarta.jms.Topic createTopic(String s) throws jakarta.jms.JMSException
      Specified by:
      createTopic in interface jakarta.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 interface jakarta.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 interface jakarta.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 interface jakarta.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 interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createSharedDurableConsumer

      public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name) throws jakarta.jms.JMSException
      Specified by:
      createSharedDurableConsumer in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createSharedDurableConsumer

      public jakarta.jms.MessageConsumer createSharedDurableConsumer(jakarta.jms.Topic topic, String name, String messageSelector) throws jakarta.jms.JMSException
      Specified by:
      createSharedDurableConsumer in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createBrowser

      public jakarta.jms.QueueBrowser createBrowser(jakarta.jms.Queue queue) throws jakarta.jms.JMSException
      Specified by:
      createBrowser in interface jakarta.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 interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createTemporaryQueue

      public jakarta.jms.TemporaryQueue createTemporaryQueue() throws jakarta.jms.JMSException
      Specified by:
      createTemporaryQueue in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • createTemporaryTopic

      public jakarta.jms.TemporaryTopic createTemporaryTopic() throws jakarta.jms.JMSException
      Specified by:
      createTemporaryTopic in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException
    • unsubscribe

      public void unsubscribe(String s) throws jakarta.jms.JMSException
      Specified by:
      unsubscribe in interface jakarta.jms.Session
      Throws:
      jakarta.jms.JMSException