/**
* 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();
}