boolean imri = false;
try {
//Note that the bits of the class need to be loaded dynamically and hence we need MBeanClassLoader
ClassLoader mbcl = new MBeanClassLoader();
Class mbc = Class.forName(className, false, mbcl);
final Class[] iifs = mbc.getInterfaces();
for (Class c : iifs) {
if (javax.management.MBeanRegistration.class.equals(c)) {
imri = true;
mbc = null; mbcl = null; // make them garbage-collectible asap :), purpose served
break;
}
}
} catch (final Exception e) {
throw new RuntimeException (e);
}
return ( imri );