converter, enhancer);
}
private <T> void registerMBean(String configFileName, T instance, XmlConfig xmlConfig, ConfigInjector<?> configInjector) throws MalformedObjectNameException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
// JMX - register the configuration MBean
ConfigDynamicBean configDynamicBean =
new ConfigDynamicBean(instance, xmlConfig.getClassName(), "", configInjector.getInjections(),
this);
ObjectName configMBeanName = new ObjectName("com.avast.syringe.instances:type=" + xmlConfig.getClassName()
+ ",name=" + configFileName);
mBeanServer.registerMBean(configDynamicBean, configMBeanName);
}