Package org.exolab.jms.administration

Examples of org.exolab.jms.administration.JmsAdminServerIfc


    /**
     * List all destinations
     */
    public static void list(String url) throws Exception {
        JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        Vector destinations = admin.getAllDestinations();
        Iterator iter = destinations.iterator();
        while (iter.hasNext()) {
            Destination destination = (Destination) iter.next();
            if (destination instanceof Queue) {
                Queue queue = (Queue) destination;
                System.out.println("queue://" + queue.getQueueName() + " [" +
                                   admin.getQueueMessageCount(queue.getQueueName()) + "]");
            } else {
                Topic topic = (Topic) destination;
                System.out.println("topic://" + topic.getTopicName());
            }
        }
        admin.close();
    }
View Full Code Here


    /**
     * Add an administered destination
     */
    public static void add(String url, String type, String name)
        throws Exception {
        JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        Boolean queue = (type.equals("queue")) ? Boolean.TRUE : Boolean.FALSE;
        if (!admin.addDestination(name, queue)) {
            System.err.println("Failed to add destination=" + name);
        }
        admin.close();
    }
View Full Code Here

     *
     * @param queue - the name of the queue
     */
    public static void queueCount(String url, String queue)
    throws Exception {
        JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        System.err.println("[" + queue + "] = " +
                           admin.getQueueMessageCount(queue));
        admin.close();
    }
View Full Code Here

     * @param topic - the name of the topic
     * @param name - the consumer name
     */
    public static void topicCount(String url, String topic, String name)
    throws Exception {                                               
        JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        System.err.println("[" + topic + ":" + name + "] = " +
                           admin.getDurableConsumerMessageCount(topic, name));
        admin.close();
    }
View Full Code Here

    /**
     * Remove an administered destination
     */
    public static void remove(String url, String name)
        throws Exception {
        JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
        if (!admin.removeDestination(name)) {
            System.err.println("Failed to remove destination=" + name);
        }
        admin.close();
    }
View Full Code Here

TOP

Related Classes of org.exolab.jms.administration.JmsAdminServerIfc

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.