Examples of ConsumerImpl


Examples of org.apache.qpid.server.consumer.ConsumerImpl

    public boolean callback(final long deliveryTag, MessageInstance message) throws AMQException
    {

        message.setRedelivered();
        final ConsumerImpl consumer = message.getDeliveredConsumer();
        if (consumer != null)
        {
            // Consumer exists
            if (!consumer.isClosed())
            {
                _msgToResend.put(deliveryTag, message);
            }
            else // consumer has gone
            {
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

    public boolean close()
    {
        boolean closed = false;
        State state = getState();

        final ConsumerImpl consumer = getConsumer();

        if(consumer != null)
        {
            consumer.getSendLock();
        }
        try
        {
            while(!closed && state != State.CLOSED)
            {
                closed = updateState(state, State.CLOSED);
                if(!closed)
                {
                    state = getState();
                }
            }
            _creditManager.removeListener(this);
            return closed;
        }
        finally
        {
            if(consumer != null)
            {
                consumer.releaseSendLock();
            }
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

    public boolean close()
    {
        boolean closed = false;
        State state = getState();

        final ConsumerImpl consumer = getConsumer();
        if(consumer != null)
        {
            consumer.getSendLock();
        }
        try
        {
            while(!closed && state != State.CLOSED)
            {
                closed = updateState(state, State.CLOSED);
                if(!closed)
                {
                    state = getState();
                }
            }
            _creditManager.removeListener(this);
            }
        finally
        {
            if(consumer != null)
            {
                consumer.releaseSendLock();
            }
        }

        return closed;
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

            target = ConsumerTarget_0_8.createGetNoAckTarget(channel,
                                                          AMQShortString.EMPTY_STRING, null,
                                                          singleMessageCredit, getDeliveryMethod, getRecordMethod);
        }

        ConsumerImpl sub = queue.addConsumer(target, null, AMQMessage.class, "", options);
        sub.flush();
        sub.close();
        return(getDeliveryMethod.hasDeliveredMessage());


    }
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

        when(queue.getParent(VirtualHost.class)).thenReturn(_virtualHost);
        when(queue.getName()).thenReturn(TEST_QUEUE);
        when(queue.isDurable()).thenReturn(true);
        when(queue.getLifetimePolicy()).thenReturn(LifetimePolicy.PERMANENT);

        ConsumerImpl consumer = mock(ConsumerImpl.class);
        when(consumer.getMessageSource()).thenReturn(queue);

        ObjectProperties properties = new ObjectProperties();
        properties.put(Property.NAME, TEST_QUEUE);
        properties.put(Property.VIRTUALHOST_NAME, TEST_VIRTUAL_HOST);
        properties.put(Property.AUTO_DELETE, false);
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

                    {
                        return message.getConnectionReference() != connectionReference;
                    }
                });
            }
            ConsumerImpl sub =
                    source.addConsumer(target,
                                       filterManager,
                                       AMQMessage.class,
                                       AMQShortString.toString(tag),
                                       options);
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

     */
    public boolean unsubscribeConsumer(AMQShortString consumerTag)
    {

        ConsumerTarget_0_8 target = _tag2SubscriptionTargetMap.remove(consumerTag);
        ConsumerImpl sub = target == null ? null : target.getConsumer();
        if (sub != null)
        {
            sub.close();
            if(sub instanceof Consumer<?>)
            {
                _consumers.remove(sub);
            }
            return true;
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

            if (_logger.isInfoEnabled())
            {
                _logger.info("Unsubscribing consumer '" + me.getKey() + "' on channel " + toString());
            }

            ConsumerImpl sub = me.getValue().getConsumer();

            if(sub != null)
            {
                sub.close();
            }
        }

        _tag2SubscriptionTargetMap.clear();
    }
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

        postRollbackTask.run();

        for(MessageInstance entry : _resendList)
        {
            ConsumerImpl sub = entry.getDeliveredConsumer();
            if(sub == null || sub.isClosed())
            {
                entry.release();
            }
            else
            {
                entry.resend();
            }
        }
        _resendList.clear();

        if(requiresSuspend)
        {
            _suspended.set(false);
            for(ConsumerTarget_0_8 sub : _tag2SubscriptionTargetMap.values())
            {
                sub.getConsumer().externalStateChange();
            }

        }
    }
View Full Code Here

Examples of org.apache.qpid.server.consumer.ConsumerImpl

            target = ConsumerTarget_0_8.createGetNoAckTarget(channel,
                                                          AMQShortString.EMPTY_STRING, null,
                                                          singleMessageCredit, getDeliveryMethod, getRecordMethod);
        }

        ConsumerImpl sub = queue.addConsumer(target, null, AMQMessage.class, "", options);
        sub.flush();
        sub.close();
        return(getDeliveryMethod.hasDeliveredMessage());


    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.