MBeanServer platform = ManagementFactory.getPlatformMBeanServer();
PluggableMBeanServerImpl pluggable = platform instanceof PluggableMBeanServerImpl ? (PluggableMBeanServerImpl)platform : new PluggableMBeanServerImpl(platform);
if (resolvedDomainName != null || expressionsDomainName != null) {
//TODO make these configurable
ConfiguredDomains configuredDomains = new ConfiguredDomains(resolvedDomainName, expressionsDomainName);
showModelPlugin = new ModelControllerMBeanServerPlugin(configuredDomains, modelControllerValue.getValue(), legacyWithProperPropertyFormat);
pluggable.addPlugin(showModelPlugin);
}
mBeanServer = pluggable;
}