Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQTopic


            // need to put this back in the inactive list
            SubscriptionKey subscriptionKey = new SubscriptionKey(view.getClientId(), view.getSubscriptionName());
            SubscriptionInfo info = new SubscriptionInfo();
            info.setClientId(subscriptionKey.getClientId());
            info.setSubscriptionName(subscriptionKey.getSubscriptionName());
            info.setDestination(new ActiveMQTopic(view.getDestinationName()));
            addInactiveSubscription(subscriptionKey, info);
        }
    }
View Full Code Here


            throw new RuntimeException("unsupported by " + destinationFactory);
        }
        PersistenceAdapter adapter = ((DestinationFactoryImpl)destinationFactory).getPersistenceAdapter();
        final List<Message> result = new ArrayList<Message>();
        try {
            ActiveMQTopic topic = new ActiveMQTopic(view.getDestinationName());
            TopicMessageStore store = adapter.createTopicMessageStore(topic);
            store.recover(new MessageRecoveryListener() {
                public boolean recoverMessage(Message message) throws Exception {
                    result.add(message);
                    return true;
View Full Code Here

    private String postfix = "";
    private String name = ">";


    public ActiveMQDestination getVirtualDestination() {
        return new ActiveMQTopic(getName());
    }
View Full Code Here

        connector.stop();
        return brokerService.removeNetworkConnector(connector);
    }

    public void addTopic(String name) throws Exception {
        broker.addDestination(getConnectionContext(broker.getContextBroker()), new ActiveMQTopic(name));
    }
View Full Code Here

    public void addQueue(String name) throws Exception {
        broker.addDestination(getConnectionContext(broker.getContextBroker()), new ActiveMQQueue(name));
    }

    public void removeTopic(String name) throws Exception {
        broker.removeDestination(getConnectionContext(broker.getContextBroker()), new ActiveMQTopic(name),
                                 1000);
    }
View Full Code Here

        ConsumerId consumerId = new ConsumerId();
        consumerId.setConnectionId(clientId);
        consumerId.setSessionId(sessionIdCounter.incrementAndGet());
        consumerId.setValue(0);
        info.setConsumerId(consumerId);
        info.setDestination(new ActiveMQTopic(topicName));
        info.setSubscriptionName(subscriberName);
        info.setSelector(selector);
        Subscription subscription = broker.addConsumer(context, info);
        broker.removeConsumer(context, info);
        if (subscription != null) {
View Full Code Here

    }

    public void start() throws Exception {
        if (started.compareAndSet(false, true)) {
            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            ActiveMQTopic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic(destination);
            consumer = session.createConsumer(advisoryTopic);
            consumer.setMessageListener(this);
        }
    }
View Full Code Here

                } else if (destination instanceof TemporaryTopic) {
                    activeMQDestination = new ActiveMQTempTopic(((Topic)destination).getTopicName());
                } else if (destination instanceof Queue) {
                    activeMQDestination = new ActiveMQQueue(((Queue)destination).getQueueName());
                } else if (destination instanceof Topic) {
                    activeMQDestination = new ActiveMQTopic(((Topic)destination).getTopicName());
                }
            }
        }

        return activeMQDestination;
View Full Code Here

        return CONNECTION_ADVISORY_TOPIC;
    }

    public static ActiveMQTopic getConsumerAdvisoryTopic(ActiveMQDestination destination) {
        if (destination.isQueue()) {
            return new ActiveMQTopic(QUEUE_CONSUMER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName());
        } else {
            return new ActiveMQTopic(TOPIC_CONSUMER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName());
        }
    }
View Full Code Here

        }
    }

    public static ActiveMQTopic getProducerAdvisoryTopic(ActiveMQDestination destination) {
        if (destination.isQueue()) {
            return new ActiveMQTopic(QUEUE_PRODUCER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName());
        } else {
            return new ActiveMQTopic(TOPIC_PRODUCER_ADVISORY_TOPIC_PREFIX + destination.getPhysicalName());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ActiveMQTopic

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.