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

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

Introduction

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

Prototype

public void setRegistrationPolicy(RegistrationPolicy registrationPolicy) 

Source Link

Document

The policy to use when attempting to register an MBean under an javax.management.ObjectName that already exists.

Usage

From source file:io.kahu.hawaii.config.KahuConfig.java

@Bean
public MBeanExporter mbeanExporter() throws ServerException {
    MBeanExporter mbeanExporter = new MBeanExporter();
    mbeanExporter.setServer(jolokiaServer());
    mbeanExporter.setRegistrationPolicy(RegistrationPolicy.IGNORE_EXISTING);
    Map<String, Object> beans = getMBeans();
    mbeanExporter.setBeans(beans);//from w  w  w  .ja v a2s .  com
    return mbeanExporter;
}