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

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

Introduction

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

Prototype

public void setAllowEagerInit(boolean allowEagerInit) 

Source Link

Document

Specify whether to allow eager initialization of candidate beans when autodetecting MBeans in the Spring application context.

Usage

From source file:ru.trett.cis.config.Beans.java

@SuppressWarnings("unchecked")
@Bean/*from   w w w.j a  va 2 s. co m*/
public MBeanExporter exporter() {
    MBeanExporter exporter = new MBeanExporter();
    exporter.setAllowEagerInit(true);
    Map<String, Object> beans = new HashMap() {
        {
            put("cis:name=DBServiceBean", database());
        }
    };
    exporter.setBeans(beans);
    return exporter;
}