protected void registerModelServices() throws NotCompliantMBeanException, MBeanRegistrationException,
InstanceAlreadyExistsException, MalformedObjectNameException
{
for (Model model : muleContext.getRegistry().lookupObjects(Model.class))
{
ModelServiceMBean service = new ModelService(model);
String rawName = service.getName() + "(" + service.getType() + ")";
String name = jmxSupport.escape(rawName);
final String jmxName = String.format("%s:%s%s", jmxSupport.getDomainName(muleContext, !containerMode), ModelServiceMBean.DEFAULT_JMX_NAME_PREFIX, name);
ObjectName on = jmxSupport.getObjectName(jmxName);
ClassloaderSwitchingMBeanWrapper mBean = new ClassloaderSwitchingMBeanWrapper(service, ModelServiceMBean.class, muleContext.getExecutionClassLoader());
logger.debug("Registering model with name: " + on);