Package org.apache.activemq.advisory

Examples of org.apache.activemq.advisory.DestinationSource


    }

    @Override
    public List<String> listQueues() {
        try {
            DestinationSource destSource = connection.getDestinationSource();
            Set<ActiveMQQueue> queues = destSource.getQueues();
            List<String> names = new ArrayList<String>();
            for (ActiveMQQueue queue : queues) {
                names.add(queue.getQueueName());
            }
            return names;
View Full Code Here


    }

    @Override
    public List<String> listTopics() {
        try {
            DestinationSource destSource = connection.getDestinationSource();
            Set<ActiveMQTopic> topics = destSource.getTopics();
            List<String> names = new ArrayList<String>();
            for (ActiveMQTopic queue : topics) {
                names.add(queue.getTopicName());
            }
            return names;
View Full Code Here

     * @return a lazily created destination source
     * @throws JMSException
     */
    public DestinationSource getDestinationSource() throws JMSException {
        if (destinationSource == null) {
            destinationSource = new DestinationSource(this);
            destinationSource.start();
        }
        return destinationSource;
    }
View Full Code Here

     * @return a lazily created destination source
     * @throws JMSException
     */
    public DestinationSource getDestinationSource() throws JMSException {
        if (destinationSource == null) {
            destinationSource = new DestinationSource(this);
            destinationSource.start();
        }
        return destinationSource;
    }
View Full Code Here

            else {
                throw new IllegalArgumentException("Created JMS Connection is not an EnhancedConnection: " + value);
            }
        }
        connection.start();
        DestinationSource source = connection.getDestinationSource();
        source.setDestinationListener(new DestinationListener() {
            public void onDestinationEvent(DestinationEvent event) {
                try {
                    ActiveMQDestination destination = event.getDestination();
                    if (destination instanceof ActiveMQQueue) {
                        ActiveMQQueue queue = (ActiveMQQueue) destination;
                        if (event.isAddOperation()) {
                            addQueue(queue);
                        }
                        else {
                            removeQueue(queue);
                        }
                    }
                }
                catch (Exception e) {
                    LOG.warn("Caught: " + e, e);
                }
            }
        });

        Set<ActiveMQQueue> queues = source.getQueues();
        for (ActiveMQQueue queue : queues) {
            addQueue(queue);
        }
    }
View Full Code Here

     * @return a lazily created destination source
     * @throws JMSException
     */
    public DestinationSource getDestinationSource() throws JMSException {
        if (destinationSource == null) {
            destinationSource = new DestinationSource(this);
            destinationSource.start();
        }
        return destinationSource;
    }
View Full Code Here

     * @return a lazily created destination source
     * @throws JMSException
     */
    public DestinationSource getDestinationSource() throws JMSException {
        if (destinationSource == null) {
            destinationSource = new DestinationSource(this);
            destinationSource.start();
        }
        return destinationSource;
    }
View Full Code Here

    @Override
    public List<String> topics(String connectionFactory, String username, String password) throws IOException, JMSException {
        JmsConnector connector = new JmsConnector(bundleContext, connectionFactory, username, password);
        try {
            DestinationSource destinationSource = getDestinationSource(connector.connect());
            List<String> topics = new ArrayList<String>();
            if (destinationSource != null) {
                Set<ActiveMQTopic> activeMQTopics = destinationSource.getTopics();
                for (ActiveMQTopic activeMQTopic : activeMQTopics) {
                    topics.add(activeMQTopic.getTopicName());
                }
            }
            return topics;
View Full Code Here

    @Override
    public List<String> queues(String connectionFactory, String username, String password) throws JMSException, IOException {
        JmsConnector connector = new JmsConnector(bundleContext, connectionFactory, username, password);
        try {
            List<String> queues = new ArrayList<String>();
            DestinationSource destinationSource = getDestinationSource(connector.connect());
            if (destinationSource != null) {
                Set<ActiveMQQueue> activeMQQueues = destinationSource.getQueues();
                for (ActiveMQQueue activeMQQueue : activeMQQueues) {
                    queues.add(activeMQQueue.getQueueName());
                }
            }
            return queues;
View Full Code Here

            connection.start();
            if (connection instanceof PooledConnection) {
                connection = ((PooledConnection) connection).getConnection();
            }
            if (connection instanceof ActiveMQConnection) {
                DestinationSource destinationSource = ((ActiveMQConnection) connection).getDestinationSource();
                Set<ActiveMQQueue> activeMQQueues = destinationSource.getQueues();
                for (ActiveMQQueue activeMQQueue : activeMQQueues) {
                    queues.add(activeMQQueue.getQueueName());
                }
            }
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.activemq.advisory.DestinationSource

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.