Class JmsPoolSession

  • All Implemented Interfaces:
    AutoCloseable, Runnable, javax.jms.QueueSession, javax.jms.Session, javax.jms.TopicSession, javax.jms.XASession

    public class JmsPoolSession
    extends Object
    implements javax.jms.Session, javax.jms.TopicSession, javax.jms.QueueSession, javax.jms.XASession, AutoCloseable
    • Method Detail

      • close

        public void close()
                   throws javax.jms.JMSException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createTemporaryQueue

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

        public javax.jms.TemporaryTopic createTemporaryTopic()
                                                      throws javax.jms.JMSException
        Specified by:
        createTemporaryTopic in interface javax.jms.Session
        Specified by:
        createTemporaryTopic in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createQueue

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

        public javax.jms.Topic createTopic​(String s)
                                    throws javax.jms.JMSException
        Specified by:
        createTopic in interface javax.jms.Session
        Specified by:
        createTopic in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createBytesMessage

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

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

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

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

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

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

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

        public javax.jms.TextMessage createTextMessage​(String s)
                                                throws javax.jms.JMSException
        Specified by:
        createTextMessage in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • unsubscribe

        public void unsubscribe​(String s)
                         throws javax.jms.JMSException
        Specified by:
        unsubscribe in interface javax.jms.Session
        Specified by:
        unsubscribe in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • getAcknowledgeMode

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

        public boolean getTransacted()
                              throws javax.jms.JMSException
        Specified by:
        getTransacted in interface javax.jms.Session
        Specified by:
        getTransacted in interface javax.jms.XASession
        Throws:
        javax.jms.JMSException
      • recover

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

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

        public void rollback()
                      throws javax.jms.JMSException
        Specified by:
        rollback in interface javax.jms.Session
        Specified by:
        rollback in interface javax.jms.XASession
        Throws:
        javax.jms.JMSException
      • getXAResource

        public XAResource getXAResource()
        Specified by:
        getXAResource in interface javax.jms.XASession
      • getSession

        public javax.jms.Session getSession()
        Specified by:
        getSession in interface javax.jms.XASession
      • getMessageListener

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

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

        public void run()
        Specified by:
        run in interface Runnable
        Specified by:
        run in interface javax.jms.Session
      • createBrowser

        public javax.jms.QueueBrowser createBrowser​(javax.jms.Queue queue)
                                             throws javax.jms.JMSException
        Specified by:
        createBrowser in interface javax.jms.QueueSession
        Specified by:
        createBrowser in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createBrowser

        public javax.jms.QueueBrowser createBrowser​(javax.jms.Queue queue,
                                                    String selector)
                                             throws javax.jms.JMSException
        Specified by:
        createBrowser in interface javax.jms.QueueSession
        Specified by:
        createBrowser in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createConsumer

        public javax.jms.MessageConsumer createConsumer​(javax.jms.Destination destination)
                                                 throws javax.jms.JMSException
        Specified by:
        createConsumer in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createConsumer

        public javax.jms.MessageConsumer createConsumer​(javax.jms.Destination destination,
                                                        String selector)
                                                 throws javax.jms.JMSException
        Specified by:
        createConsumer in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createConsumer

        public javax.jms.MessageConsumer createConsumer​(javax.jms.Destination destination,
                                                        String selector,
                                                        boolean noLocal)
                                                 throws javax.jms.JMSException
        Specified by:
        createConsumer in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createDurableSubscriber

        public javax.jms.TopicSubscriber createDurableSubscriber​(javax.jms.Topic topic,
                                                                 String selector)
                                                          throws javax.jms.JMSException
        Specified by:
        createDurableSubscriber in interface javax.jms.Session
        Specified by:
        createDurableSubscriber in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createDurableSubscriber

        public javax.jms.TopicSubscriber createDurableSubscriber​(javax.jms.Topic topic,
                                                                 String name,
                                                                 String selector,
                                                                 boolean noLocal)
                                                          throws javax.jms.JMSException
        Specified by:
        createDurableSubscriber in interface javax.jms.Session
        Specified by:
        createDurableSubscriber in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createSubscriber

        public javax.jms.TopicSubscriber createSubscriber​(javax.jms.Topic topic)
                                                   throws javax.jms.JMSException
        Specified by:
        createSubscriber in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createSubscriber

        public javax.jms.TopicSubscriber createSubscriber​(javax.jms.Topic topic,
                                                          String selector,
                                                          boolean local)
                                                   throws javax.jms.JMSException
        Specified by:
        createSubscriber in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • createReceiver

        public javax.jms.QueueReceiver createReceiver​(javax.jms.Queue queue)
                                               throws javax.jms.JMSException
        Specified by:
        createReceiver in interface javax.jms.QueueSession
        Throws:
        javax.jms.JMSException
      • createReceiver

        public javax.jms.QueueReceiver createReceiver​(javax.jms.Queue queue,
                                                      String selector)
                                               throws javax.jms.JMSException
        Specified by:
        createReceiver in interface javax.jms.QueueSession
        Throws:
        javax.jms.JMSException
      • createSharedConsumer

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

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

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

        public javax.jms.MessageConsumer createDurableConsumer​(javax.jms.Topic topic,
                                                               String name,
                                                               String messageSelector,
                                                               boolean noLocal)
                                                        throws javax.jms.JMSException
        Specified by:
        createDurableConsumer in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createSharedDurableConsumer

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

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

        public javax.jms.MessageProducer createProducer​(javax.jms.Destination destination)
                                                 throws javax.jms.JMSException
        Specified by:
        createProducer in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createSender

        public javax.jms.QueueSender createSender​(javax.jms.Queue queue)
                                           throws javax.jms.JMSException
        Specified by:
        createSender in interface javax.jms.QueueSession
        Throws:
        javax.jms.JMSException
      • createPublisher

        public javax.jms.TopicPublisher createPublisher​(javax.jms.Topic topic)
                                                 throws javax.jms.JMSException
        Specified by:
        createPublisher in interface javax.jms.TopicSession
        Throws:
        javax.jms.JMSException
      • addSessionEventListener

        public void addSessionEventListener​(JmsPoolSessionEventListener listener)
                                     throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getInternalSession

        public javax.jms.Session getInternalSession()
                                             throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • setIsXa

        public void setIsXa​(boolean isXa)
      • isIgnoreClose

        public boolean isIgnoreClose()
      • setIgnoreClose

        public void setIgnoreClose​(boolean ignoreClose)
      • onConsumerClose

        protected void onConsumerClose​(JmsPoolMessageConsumer consumer)
        Callback invoked when the consumer is closed.

        This is used to keep track of an explicit closed consumer created by this session so that the internal tracking data structures can be cleaned up.

        Parameters:
        consumer - the consumer which is being closed.
      • onQueueBrowserClose

        protected void onQueueBrowserClose​(JmsPoolQueueBrowser browser)
        Callback invoked when the consumer is closed.

        This is used to keep track of an explicit closed browser created by this session so that the internal tracking data structures can be cleaned up.

        Parameters:
        browser - the browser which is being closed.
      • onMessageProducerClosed

        protected void onMessageProducerClosed​(JmsPoolMessageProducer producer,
                                               boolean force)
                                        throws javax.jms.JMSException
        Callback invoked when the producer is closed.

        This is used to keep track of an explicit closed producer created by this session so that the internal tracking data structures can be cleaned up.

        Parameters:
        producer - the producer which is being closed.
        force - should the producer be closed regardless of other configuration
        Throws:
        javax.jms.JMSException - if an error occurs while closing the provider MessageProducer.
      • checkClientJMSVersionSupport

        protected void checkClientJMSVersionSupport​(int major,
                                                    int minor)
                                             throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • isJMSVersionSupported

        protected boolean isJMSVersionSupported​(int major,
                                                int minor)
                                         throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException