I found on Internet the following example:
//MBean related imports:
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.mq.server.jmx.DestinationManagerMBean;
...
// target MBean: DestinationManager
ObjectName objectName = new ObjectName("jboss.mq:service=DestinationManager");
// find the local MBeanServer
MBeanServer server = MBeanServerLocator.locateJBoss();
// Get a type-safe dynamic proxy
DestinationManagerMBean mbean =
(DestinationManagerMBean)MBeanServerInvocationHandler.newProxyInstance(
server,
objectName,
DestinationManagerMBean.class,
false);
// Use the proxy to dynamically create a queue
// by providing the queue name and the JNDI location
mbean.createQueue("myUgatz", "queue/myUgatz");
Unfortunately, I can not find anywhere the JAR containing DestinationManagerMBean class. Please help to locate it. Great thanks.
The follow up question that I have is if it is possible to dynamically create ESB action listening on this Queue or End point and Action to be precise. Thanks again,
Stas Zelivinski
http://www.findjar.com/class/org/jboss/mq/server/jmx/DestinationManagerMBean.html
good tool for locating class files.