Class MessageConsumerListener

    • Field Detail

      • logger

        private static final org.objectweb.util.monolog.api.Logger logger
      • queueMode

        private boolean queueMode
      • durable

        private boolean durable
      • selector

        private String selector
      • destName

        private String destName
      • targetName

        private String targetName
      • requestId

        private volatile int requestId
        The identifier of the subscription request.
      • status

        private int status
      • messageCount

        private volatile int messageCount
        The number of messages which are in queue (Session.qin) waiting for being consumed. TODO (AF): Always used from synchronized block, removes volatile.
      • receiveStatus

        private volatile int receiveStatus
        The receive status of this message listener: - WAIT_FOR_REPLY if a reply is expected from the destination - CONSUMING_REPLY if a reply is being consumed and no new request has been sent
      • topicMsgInputPassivated

        private boolean topicMsgInputPassivated
        Indicates whether the topic message input has been passivated or not.
      • waitingMessagesBrokerSide

        private boolean waitingMessagesBrokerSide
        This attribute indicates that there are still pending messages on the broker for this subscription. If no new messages arrive, these messages may not be delivered.
      • queueMessageReadMax

        private int queueMessageReadMax
      • topicActivationThreshold

        private int topicActivationThreshold
      • topicPassivationThreshold

        private int topicPassivationThreshold
      • topicAckBufferMax

        private int topicAckBufferMax
      • listenerPosition

        private int listenerPosition
    • Constructor Detail

      • MessageConsumerListener

        MessageConsumerListener​(boolean queueMode,
                                boolean durable,
                                String selector,
                                String destName,
                                String targetName,
                                MessageListener listener,
                                int queueMessageReadMax,
                                int topicActivationThreshold,
                                int topicPassivationThreshold,
                                int topicAckBufferMax,
                                RequestMultiplexer reqMultiplexer)
    • Method Detail

      • getDestName

        public final String getDestName()
      • getStatus

        protected final int getStatus()
      • setStatus

        protected void setStatus​(int status)
      • setReceiveStatus

        private void setReceiveStatus​(int s)
      • decreaseMessageCount

        private void decreaseMessageCount​(int ackMode)
                                   throws JMSException
        Decrease the message count. Synchronized with the method replyReceived() that increments the messageCount += cm.getMessageCount();
        Throws:
        JMSException
      • checkSessionThread

        protected abstract boolean checkSessionThread()
        Returns:
        true if the currentThread is the SessionThread.
      • acknowledge

        private void acknowledge​(int threshold)
      • pushMessages

        public abstract void pushMessages​(org.objectweb.joram.shared.client.ConsumerMessages cm)
                                   throws JMSException
        Pushes the received messages. Currently two behaviors: 1- SingleSessionConsumer pushes the message in a single session (standard JMS) 2- MultiSessionConsumer pushes the message in several session (from a session pool)
        Parameters:
        cm -
        Throws:
        JMSException
      • errorReceived

        public void errorReceived​(int requestId,
                                  org.objectweb.joram.shared.client.MomExceptionReply exc)
        Specified by:
        errorReceived in interface ReplyListener
      • isClosed

        public boolean isClosed()
      • getQueueMode

        public final boolean getQueueMode()
      • getTargetName

        public final String getTargetName()
      • addMessageListener

        void addMessageListener​(MessageListener messageListener)
      • removeMessageListener

        boolean removeMessageListener​(MessageListener messageListener)
      • getMessageListenersSize

        public int getMessageListenersSize()
      • onMessage

        public void onMessage​(Message msg,
                              int ackMode)
                       throws JMSException
        Called by Session (standard JMS, mono-threaded)
        Throws:
        JMSException
      • activateMessageInput

        void activateMessageInput()
                           throws JMSException
        Activate the subscription server side. This method is idempotent.
        Throws:
        JMSException
      • passivateMessageInput

        void passivateMessageInput()
                            throws JMSException
        Passivate the subscription server side. This method is idempotent.
        Throws:
        JMSException