use of org.springframework.jmx.export.annotation.AnnotationMBeanExporter in project spring-framework by spring-projects.
the class MBeanExportConfiguration method mbeanExporter.
@Bean(name = MBEAN_EXPORTER_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AnnotationMBeanExporter mbeanExporter() {
AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
Assert.state(this.enableMBeanExport != null, "No EnableMBeanExport annotation found");
setupDomain(exporter, this.enableMBeanExport);
setupServer(exporter, this.enableMBeanExport);
setupRegistrationPolicy(exporter, this.enableMBeanExport);
return exporter;
}
use of org.springframework.jmx.export.annotation.AnnotationMBeanExporter in project spring-boot by spring-projects.
the class JmxAutoConfiguration method mbeanExporter.
@Bean
@Primary
@ConditionalOnMissingBean(value = MBeanExporter.class, search = SearchStrategy.CURRENT)
public AnnotationMBeanExporter mbeanExporter(ObjectNamingStrategy namingStrategy, BeanFactory beanFactory) {
AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
exporter.setRegistrationPolicy(RegistrationPolicy.FAIL_ON_EXISTING);
exporter.setNamingStrategy(namingStrategy);
String serverBean = this.environment.getProperty("spring.jmx.server", "mbeanServer");
if (StringUtils.hasLength(serverBean)) {
exporter.setServer(beanFactory.getBean(serverBean, MBeanServer.class));
}
return exporter;
}
use of org.springframework.jmx.export.annotation.AnnotationMBeanExporter in project spring-boot by spring-projects.
the class JmxAutoConfiguration method mbeanExporter.
@Bean
@Primary
@ConditionalOnMissingBean(value = MBeanExporter.class, search = SearchStrategy.CURRENT)
public AnnotationMBeanExporter mbeanExporter(ObjectNamingStrategy namingStrategy) {
AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
exporter.setRegistrationPolicy(RegistrationPolicy.FAIL_ON_EXISTING);
exporter.setNamingStrategy(namingStrategy);
String server = this.propertyResolver.getProperty("server", "mbeanServer");
if (StringUtils.hasLength(server)) {
exporter.setServer(this.beanFactory.getBean(server, MBeanServer.class));
}
return exporter;
}
Aggregations