throw new MBeanException
(ex, "Cannot load ModelMBean class " + getClassName());
}
// Create a new ModelMBean instance
ModelMBean mbean = null;
try {
mbean = (ModelMBean) clazz.newInstance();
mbean.setModelMBeanInfo(createMBeanInfo());
} catch (MBeanException e) {
throw e;
} catch (RuntimeOperationsException e) {
throw e;
} catch (Exception e) {
throw new MBeanException
(e, "Cannot instantiate ModelMBean of class " +
getClassName());
}
// Set the managed resource (if any)
try {
if (instance != null)
mbean.setManagedResource(instance, "ObjectReference");
} catch (InstanceNotFoundException e) {
throw e;
} catch (InvalidTargetObjectTypeException e) {
throw e;
}