{
return new ObjectInstance(server.createMBean(className, name, loader, params, signature));
}
catch (ReflectionException re)
{
ManagementException me = new ManagementException();
me.setMessage(CREATE_ERR, new Object[] {name});
me.setRootCause(re);
throw me;
}
catch (InstanceAlreadyExistsException iaee)
{
ManagementException me = new ManagementException();
me.setMessage(INSTANCE_EXISTS, new Object[] {name});
me.setRootCause(iaee);
throw me;
}
catch (MBeanException mbe)
{
ManagementException me = new ManagementException();
me.setMessage(CREATE_ERR, new Object[] {name});
me.setRootCause(mbe);
throw me;
}
catch (NotCompliantMBeanException ncmbe)
{
ManagementException me = new ManagementException();
me.setMessage(NOT_COMPLIANT, new Object[] {className});
me.setRootCause(ncmbe);
throw me;
}
catch (InstanceNotFoundException infe)
{
ManagementException me = new ManagementException();
me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
me.setRootCause(infe);
throw me;
}
}