Class AbstractSession

  • All Implemented Interfaces:
    Runnable, javax.jms.Session
    Direct Known Subclasses:
    LocalSession, RemoteSession

    public abstract class AbstractSession
    extends Object
    implements javax.jms.Session

    Base implementation for a JMS Session

    • Constructor Detail

      • AbstractSession

        public AbstractSession​(AbstractConnection connection,
                               boolean transacted,
                               int acknowledgeMode)
        Constructor
      • AbstractSession

        public AbstractSession​(IntegerID id,
                               AbstractConnection connection,
                               boolean transacted,
                               int acknowledgeMode)
        Constructor
    • Method Detail

      • getId

        public final IntegerID getId()
        Get the session id
        Returns:
        the id
      • checkNotClosed

        protected final void checkNotClosed()
                                     throws javax.jms.JMSException
        Check that the session is not closed
        Throws:
        javax.jms.JMSException
      • close

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

        protected void onSessionClose()
      • onSessionClosed

        protected void onSessionClosed()
      • checkTemporaryDestinationScope

        public final void checkTemporaryDestinationScope​(javax.jms.Destination destination)
                                                  throws javax.jms.JMSException
        Check temporary destinations scope (JMS Spec 4.4.3 p2)
        Parameters:
        destination - destination to check
        Throws:
        javax.jms.JMSException
      • wakeUpConsumers

        public final void wakeUpConsumers()
                                   throws javax.jms.JMSException
        Wake up all children consumers
        Throws:
        javax.jms.JMSException
      • registerConsumer

        protected final void registerConsumer​(AbstractMessageConsumer consumer)
        Register a consumer
      • registerProducer

        protected final void registerProducer​(AbstractMessageProducer producer)
        Register a producer
      • registerBrowser

        protected final void registerBrowser​(AbstractQueueBrowser browser)
        Register a browser
      • unregisterConsumer

        protected final void unregisterConsumer​(AbstractMessageConsumer consumerToRemove)
        Unregister a consumer
      • unregisterProducer

        protected final void unregisterProducer​(AbstractMessageProducer producerToRemove)
        Unregister a producer
      • unregisterBrowser

        protected final void unregisterBrowser​(AbstractQueueBrowser browserToRemove)
        Unregister a browser
      • acknowledge

        public abstract void acknowledge()
                                  throws javax.jms.JMSException
        Acknowledge the given message
        Throws:
        javax.jms.JMSException
      • createMessage

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public final javax.jms.MessageConsumer createConsumer​(javax.jms.Destination destination)
                                                       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 name)
                                                          throws javax.jms.JMSException
        Specified by:
        createDurableSubscriber in interface javax.jms.Session
        Throws:
        javax.jms.JMSException
      • createBrowser

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

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

        public final int getConsumersCount()
        Get the number of active producers for this session
        Returns:
        the number of active producers for this session
      • getProducersCount

        public final int getProducersCount()
        Get the number of active producers for this session
        Returns:
        the number of active producers for this session
      • getEntitiesDescription

        public final void getEntitiesDescription​(StringBuilder sb)
        Get a description of entities held by this object
      • waitForDeliverySync

        public final void waitForDeliverySync()