This is what we do and it works well for us.
public static Object getMBean(String name) {
try {
ObjectName myBeanContainerName = new ObjectName(name);
Object myParams[] = { myBeanContainerName };
String mySig[] = {"javax.management.ObjectName"};
MBeanServer myServer = (MBeanServer)
MBeanServerFactory.findMBeanServer(null).get(0);
MBeanEntry myContainerEntry = (MBeanEntry)myServer.invoke(new
ObjectName("JMImplementation:type=MBeanRegistry"),
"get",
myParams,
mySig);
mbean = myContainerEntry.getResourceInstance();
// Handle XMBeans
if (mbean instanceof XMBean) {
XMBean xmBean = (XMBean)mbean;
mbean = xmBean.getResource();
}
return mbean;
}
catch(Throwable e) {
throw new RuntimeException(e);
}
}
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831659#3831659
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831659
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user