Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ConsumerInfo


            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.setStarted(true);
            client.consumeConsumerInfo(consumerInfo);

            consumerInfo = new ConsumerInfo();
            consumerInfo.setDestination(new ActiveMQQueue(">"));
            consumerInfo.setNoLocal(true);
            consumerInfo.setClientId(brokerClientID);
            consumerInfo.setConsumerId(idGenerator.generateId());
            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


                            TransactionInfo info = (TransactionInfo) packet;
                            consumeTransactionInfo(info);
                            break;
                        }
                        case Packet.CONSUMER_INFO : {
                            ConsumerInfo info = (ConsumerInfo) packet;
                            consumeConsumerInfo(info);
                            break;
                        }
                        case Packet.PRODUCER_INFO : {
                            ProducerInfo info = (ProducerInfo) packet;
View Full Code Here

     */
    private void consumeCleanupConnectionInfo(CleanupConnectionInfo cleanupInfo) throws JMSException {
        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

                    // Dispatch any queued
                    log.debug(this + " has started running client version " + info.getClientVersion()
                            + " , wire format = " + info.getWireFormatVersion());
                    //go through consumers, producers, and sessions - setting their clientId (which might not have been set)
                    for (Iterator i = consumers.iterator();i.hasNext();) {
                        ConsumerInfo ci = (ConsumerInfo) i.next();
                        ci.setClientId(info.getClientId());
                    }
                    for (Iterator i = producers.iterator();i.hasNext();) {
                        ProducerInfo pi = (ProducerInfo) i.next();
                        pi.setClientId(info.getClientId());
                    }
View Full Code Here

        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

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

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

     */
    public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector,
                                                       ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ensureClientIDInitialised();
        ConsumerInfo info = new ConsumerInfo();
        info.setConsumerId(this.handleIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(topic));
        info.setSelector(messageSelector);
        info.setConsumerNo(handleIdGenerator.getNextShortSequence());
        return new ActiveMQConnectionConsumer(this, sessionPool, info, maxMessages);
    }
View Full Code Here

     */
    public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector,
                                                       ServerSessionPool sessionPool, int maxMessages) throws JMSException {
        checkClosed();
        ensureClientIDInitialised();
        ConsumerInfo info = new ConsumerInfo();
        info.setConsumerId(this.handleIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation.transformDestination(queue));
        info.setSelector(messageSelector);
        info.setConsumerNo(handleIdGenerator.getNextShortSequence());
        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

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.