jboss怎样动态创建destination
我在写个小QQ 要动态创建destination,希望懂的人指教! 不胜感激
[解决办法]
我的jboss是5.1.0 ,我要动态创建destination 我这样做
MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).iterator().next();
System.out.println(server);
ObjectName factoryQueue = new ObjectName("jboss.mq", "service", "DestinationManager");
Object o = server.getObjectInstance(factoryQueue);
System.out.println(o);
Method[] ms = o.getClass().getMethods();
for(Method m:ms){
System.out.println(m);
}
String sQueue = "desgen";
server.invoke(factoryQueue,"createQueue",new Object[] { sQueue },new String[]{ "java.lang.String" } );