final GenericBeanDefinition bean = new GenericBeanDefinition();
bean.setBeanClass(MBeanExporter.class);
MutablePropertyValues properties = new MutablePropertyValues();
properties.add("server", ManagementFactory.getPlatformMBeanServer());
properties.add("autodetectMode", MBeanExporter.AUTODETECT_ASSEMBLER);
properties.add("assembler", new MetadataMBeanInfoAssembler(annotationSource));
properties.add("namingStrategy", new MBeanNamingStrategy(annotationSource).setDefaultDomain(defaultDomain));
bean.setPropertyValues(properties);
return bean;
}