Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ConsumerInfo


        if (!cleanedUp) {
            cleanedUp = true;
            try {
                try {
                    for (Iterator i = consumers.iterator();i.hasNext();) {
                        ConsumerInfo info = (ConsumerInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterMessageConsumer(this, info);
                    }
                    for (Iterator i = producers.iterator();i.hasNext();) {
                        ProducerInfo info = (ProducerInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterMessageProducer(this, info);
                    }
                    for (Iterator i = sessions.iterator();i.hasNext();) {
                        SessionInfo info = (SessionInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterSession(this, info);
                    }
                    for (Iterator i = transactions.iterator();i.hasNext();) {
                        this.brokerConnector.rollbackTransaction(this, i.next().toString());
                    }
View Full Code Here


     * @see javax.jms.ConnectionConsumer
     */
    public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector,
                                                       ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ConsumerInfo info = new ConsumerInfo();
        info.setId(this.packetIdGenerator.generateId());
        info.setConsumerId(this.consumerIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(topic));
        info.setSelector(messageSelector);
        return new ActiveMQConnectionConsumer(this, sessionPool, info, maxMessages);
    }
View Full Code Here

     * @see javax.jms.ConnectionConsumer
     */
    public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector,
                                                       ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ConsumerInfo info = new ConsumerInfo();
        info.setId(this.packetIdGenerator.generateId());
        info.setConsumerId(this.consumerIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(queue));
        info.setSelector(messageSelector);
        return new ActiveMQConnectionConsumer(this, sessionPool, info, maxMessages);
    }
View Full Code Here

                sessionInfo.setStarted(true);
                asyncSendPacket(sessionInfo, false);
                //send consumers
                for (Iterator consumersIterator = session.consumers.iterator(); consumersIterator.hasNext();) {
                    ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) consumersIterator.next();
                    ConsumerInfo consumerInfo = session.createConsumerInfo(consumer);
                    consumerInfo.setStarted(true);
                    asyncSendPacket(consumerInfo, false);
                }
                //send producers
                for (Iterator producersIterator = session.producers.iterator(); producersIterator.hasNext();) {
                    ActiveMQMessageProducer producer = (ActiveMQMessageProducer) producersIterator.next();
View Full Code Here

     * @since 1.1
     */
    public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector,
                                                       ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ConsumerInfo info = new ConsumerInfo();
        info.setId(this.packetIdGenerator.generateId());
        info.setConsumerId(consumerIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(destination));
        info.setSelector(messageSelector);
        return new ActiveMQConnectionConsumer(this, sessionPool, info, maxMessages);
    }
View Full Code Here

     * @since 1.1
     */
    public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName,
                                                              String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ConsumerInfo info = new ConsumerInfo();
        info.setId(this.packetIdGenerator.generateId());
        info.setConsumerId(this.consumerIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(topic));
        info.setSelector(messageSelector);
        info.setConsumerName(subscriptionName);
        return new ActiveMQConnectionConsumer(this, sessionPool, info, maxMessages);
    }
View Full Code Here

        }
    }

    protected Subscription createSubscription() throws JMSException {
        DestinationFilter filter = DestinationFilter.parseFilter(destination);
        ConsumerInfo consumerInfo = createConsumerInfo();

        // lets register the subscription with the manager
        messageContainerManager.addMessageConsumer(client, consumerInfo);

        return new DurableTopicSubscription(new DispatcherImpl(), client, consumerInfo, filter, new RedeliveryPolicy());
View Full Code Here

        return new DurableTopicSubscription(new DispatcherImpl(), client, consumerInfo, filter, new RedeliveryPolicy());
    }

    protected ConsumerInfo createConsumerInfo() {
        ConsumerInfo answer = new ConsumerInfo();
        answer.setClientId(getClientID());
        answer.setConsumerId(idGenerator.generateId());
        answer.setConsumerName(getConsumerName());
        answer.setDestination(destination);
        answer.setPrefetchNumber(100);
        answer.setSessionId(idGenerator.generateId());
        answer.setStarted(true);
        return answer;
    }
View Full Code Here

        assertEquals("queueC", false, queueC.flushMessages().contains(message));
        assertEquals("queueD", true, queueD.flushMessages().contains(message));
    }

    protected void addSubscription(String subject, String selector, BrokerClient client, boolean topic) throws JMSException {
        ConsumerInfo info = createConsumer(subject, selector);
        broker.addMessageConsumer(client, info);
    }
View Full Code Here

            info.setHostName(IdGenerator.getHostName());
            info.setClientId(brokerClientID);
            info.setStarted(true);
            client.consumeConnectionInfo(info);

            ConsumerInfo consumerInfo = new ConsumerInfo();
            consumerInfo.setDestination(new ActiveMQTopic(">"));
            consumerInfo.setNoLocal(true);
            consumerInfo.setClientId(brokerClientID);
            consumerInfo.setConsumerId(idGenerator.generateId());
            consumerInfo.setId(consumerInfo.getConsumerId());
            consumerInfo.setStarted(true);
            client.consumeConsumerInfo(consumerInfo);

            consumerInfo = new ConsumerInfo();
            consumerInfo.setDestination(new ActiveMQQueue(">"));
            consumerInfo.setNoLocal(true);
            consumerInfo.setClientId(brokerClientID);
            consumerInfo.setConsumerId(idGenerator.generateId());
            consumerInfo.setId(consumerInfo.getConsumerId());
            consumerInfo.setStarted(true);
            client.consumeConsumerInfo(consumerInfo);
        }

        // now lets create a VM channel that the JMS client will use
        // to connect to the embedded brokerConnector
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.ConsumerInfo

Copyright © 2018 www.massapicom. 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.