Package org.activemq.message

Examples of org.activemq.message.ConsumerInfo


     *
     * @param event
     */
    public void onEvent(ConsumerAdvisoryEvent event) {
        if (started.get()) {
            ConsumerInfo info = event.getInfo();
            if (info.isStarted()) {
                for (Iterator i = broker.getRegistry().getLocalComponentConnectors().iterator();i.hasNext();) {
                    LocalComponentConnector lcc = (LocalComponentConnector) i.next();
                    ComponentPacket packet = lcc.getPacket();
                    ComponentPacketEvent cpe = new ComponentPacketEvent(packet, ComponentPacketEvent.ACTIVATED);
                    onEvent(cpe);
                }
            }
            else {
                removeAllPackets(info.getClientId());
            }
        }
    }
View Full Code Here


     *
     * @param event
     */
    public void onEvent(ConsumerAdvisoryEvent event) {
        if (started.get()) {
            ConsumerInfo info = event.getInfo();
            if (info.isStarted()) {
                for (Iterator i = broker.getRegistry().getLocalComponentConnectors().iterator();i.hasNext();) {
                    LocalComponentConnector lcc = (LocalComponentConnector) i.next();
                    ComponentPacket packet = lcc.getPacket();
                    ComponentPacketEvent cpe = new ComponentPacketEvent(packet, ComponentPacketEvent.ACTIVATED);
                    onEvent(cpe);
                }
            }
            else {
                removeAllPackets(info.getClientId());
            }
        }
    }
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

            String messageSelector, ServerSessionPool sessionPool,
            int maxMessages, boolean noLocal) throws JMSException {
       
        checkClosed();
        ensureClientIDInitialised();
        ConsumerInfo info = new ConsumerInfo();
        info.setConsumerId(handleIdGenerator.generateId());
        info.setDestination(ActiveMQMessageTransformation
                .transformDestination(destination));
        info.setSelector(messageSelector);
        info.setConsumerNo(handleIdGenerator.getNextShortSequence());
        info.setNoLocal(noLocal);
        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 createDurableConnectionConsumer(Topic topic,
            String subscriptionName, String messageSelector,
            ServerSessionPool sessionPool, int maxMessages, boolean noLocal) 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.setNoLocal(noLocal);
        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

        // 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();) {
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(),new DeadLetterPolicy());
View Full Code Here

TOP

Related Classes of org.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.