Example usage for org.springframework.jmx.export MBeanExporter AUTODETECT_ASSEMBLER

List of usage examples for org.springframework.jmx.export MBeanExporter AUTODETECT_ASSEMBLER

Introduction

In this page you can find the example usage for org.springframework.jmx.export MBeanExporter AUTODETECT_ASSEMBLER.

Prototype

int AUTODETECT_ASSEMBLER

To view the source code for org.springframework.jmx.export MBeanExporter AUTODETECT_ASSEMBLER.

Click Source Link

Document

Autodetection mode indicating that only the MBeanInfoAssembler should be able to autodetect beans.

Usage

From source file:co.paralleluniverse.common.spring.SpringContainerHelper.java

private static BeanDefinition getMBeanExporterBeanDefinition(String defaultDomain) {
    final AnnotationJmxAttributeSource annotationSource = new AnnotationJmxAttributeSource();

    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);/*w w  w .  ja  va2s  .c o m*/
    return bean;
}