}
protected void registerApplicationServices() throws NotCompliantMBeanException, MBeanRegistrationException,
InstanceAlreadyExistsException, MalformedObjectNameException
{
FlowConstructStatistics appStats = muleContext.getStatistics().getApplicationStatistics();
if (appStats != null)
{
final String rawName = appStats.getName();
final String name = jmxSupport.escape(rawName);
final String jmxName = String.format("%s:type=%s,name=%s", jmxSupport.getDomainName(muleContext, !containerMode), appStats.getFlowConstructType(), name);
ObjectName on = jmxSupport.getObjectName(jmxName);
FlowConstructServiceMBean fcMBean = new ApplicationService(appStats.getFlowConstructType(), rawName, muleContext,appStats);
ClassloaderSwitchingMBeanWrapper wrapper = new ClassloaderSwitchingMBeanWrapper(fcMBean, FlowConstructServiceMBean.class, muleContext.getExecutionClassLoader());
logger.debug("Registering application statistics with name: " + on);
mBeanServer.registerMBean(wrapper, on);
}
}