//Try to register as a Standard MBean
try {
registerMBeanWithServer(obj, persist(name), forceRegistration);
} catch (NotCompliantMBeanException e) {
//If this is not a "normal" MBean, then try to deploy it using JMX annotations
ModelMBeanAssembler assembler = new ModelMBeanAssembler();
ModelMBeanInfo mbi = assembler.getModelMbeanInfo(obj.getClass());
register(obj, name, mbi, forceRegistration);
}
}