BEA Weblogic Question:
Download Questions PDF

How do I programmatically get a list of Queues or Topics?

Answer:

The following program uses Mbeans:

import weblogic.management.*;
import weblogic.management.configuration.*;


InitialContext ic = new InitialContext();
MBeanHome home = (MBeanHome)ic.lookup(MBeanHome.ADMIN_JNDI_NAME);
for(Iterator i = o.getMBeansByType("JMSTopic").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("topic name found: " + wmb.getName());
}


for(Iterator i = o.getMBeansByType("JMSQueue").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("queue name found: " + wmb.getName());
}

Download BEA Weblogic Interview Questions And Answers PDF

Previous QuestionNext Question
Can I still use the default connection factories supported in WebLogic Release 5.1?Can two JMS servers share the same persistent store?