Class WmSessionSubscriber

    • Field Detail

      • _subscriberTopic

        protected WmTopicImpl _subscriberTopic
      • _subscriberDurableName

        protected java.lang.String _subscriberDurableName
      • _subscriberSelector

        protected java.lang.String _subscriberSelector
      • _subscriberNoLocal

        protected boolean _subscriberNoLocal
      • _subscriberClosed

        protected boolean _subscriberClosed
    • Constructor Detail

      • WmSessionSubscriber

        protected WmSessionSubscriber​(WmSessionImpl session,
                                      WmTopicImpl topic,
                                      java.lang.String durableName,
                                      java.lang.String selector,
                                      boolean noLocal)
                               throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • WmSessionSubscriber

        protected WmSessionSubscriber​(WmSessionImpl session)
        Default constructor called from subclasses.
    • Method Detail

      • create

        protected static WmSessionSubscriber create​(WmSessionImpl session,
                                                    WmTopicImpl topic,
                                                    java.lang.String durableName,
                                                    java.lang.String selector,
                                                    boolean noLocal)
                                             throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • getMessageSelector

        public java.lang.String getMessageSelector()
                                            throws javax.jms.JMSException
        Specified by:
        getMessageSelector in interface javax.jms.MessageConsumer
        Throws:
        javax.jms.JMSException
      • getMessageListener

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

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

        public boolean waitForMessages​(long time)
        Wait for messages to come to the queue.
      • getAndAckMessage

        public javax.jms.Message getAndAckMessage()
                                           throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • receive

        public javax.jms.Message receive()
                                  throws javax.jms.JMSException
        Specified by:
        receive in interface javax.jms.MessageConsumer
        Throws:
        javax.jms.JMSException
      • receive

        public javax.jms.Message receive​(long timeout)
                                  throws javax.jms.JMSException
        Specified by:
        receive in interface javax.jms.MessageConsumer
        Throws:
        javax.jms.JMSException
      • receiveNoWait

        public javax.jms.Message receiveNoWait()
                                        throws javax.jms.JMSException
        Specified by:
        receiveNoWait in interface javax.jms.MessageConsumer
        Throws:
        javax.jms.JMSException
      • close

        public void close()
                   throws javax.jms.JMSException
        Specified by:
        close in interface javax.jms.MessageConsumer
        Specified by:
        close in interface WmMessageConsumer
        Throws:
        javax.jms.JMSException
      • getTopic

        public javax.jms.Topic getTopic()
                                 throws javax.jms.JMSException
        Specified by:
        getTopic in interface javax.jms.TopicSubscriber
        Throws:
        javax.jms.JMSException
      • getNoLocal

        public boolean getNoLocal()
                           throws javax.jms.JMSException
        Specified by:
        getNoLocal in interface javax.jms.TopicSubscriber
        Throws:
        javax.jms.JMSException
      • setMaxReceive

        public void setMaxReceive​(int maxReceive)
                           throws javax.jms.JMSException
        Description copied from interface: WmMessageConsumer
        Set the maximum receive value for this message consumer. The message consumer will accumulate at most this number of messages at a time.
        Specified by:
        setMaxReceive in interface WmMessageConsumer
        Parameters:
        maxReceive - the maximum number of messages to be accumulated by this message consumer
        Throws:
        javax.jms.JMSException - if the JMS provider fails to set the maximum receive value.
        See Also:
        WmMessageConsumer.getMaxReceive()
      • getMaxReceive

        public int getMaxReceive()
                          throws javax.jms.JMSException
        Description copied from interface: WmMessageConsumer
        Get the maximum receive value for this message consumer. The message consumer will accumulate at most this number of messages at a time.
        Specified by:
        getMaxReceive in interface WmMessageConsumer
        Returns:
        the maximum number of messages to be accumulated by this message consumer
        Throws:
        javax.jms.JMSException - if the JMS provider fails to get the maximum receive value.
        See Also:
        WmMessageConsumer.setMaxReceive(int)
      • getDestination

        public javax.jms.Destination getDestination()
        Description copied from interface: WmMessageConsumer
        Get the Destination associated with this consumer.
        Specified by:
        getDestination in interface WmMessageConsumer
        Returns:
        this consumer's Destination
      • available

        public long available()
        Description copied from interface: WmMessageConsumer
        Gets the number of messages on the Broker available to the consumer. This is an approximate number in that some of the messages may be expired or don't match the consumer's message selector.
        Specified by:
        available in interface WmMessageConsumer
        Returns:
        the number of messages available to the consumer
      • clear

        public void clear()
        Description copied from interface: WmMessageConsumer
        Clears all available messages to the consumer from the Broker.
        Specified by:
        clear in interface WmMessageConsumer
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws javax.jms.JMSException
        Description copied from interface: WmMessageConsumer
        Returns an InputStream that reads data from a MessageConsumer.
        Specified by:
        getInputStream in interface WmMessageConsumer
        Returns:
        an InputStream
        Throws:
        javax.jms.JMSException - if the MessageConsumer's InputStream could not be returned.