Example usage for org.springframework.boot.actuate.endpoint.jmx EndpointMBean EndpointMBean

List of usage examples for org.springframework.boot.actuate.endpoint.jmx EndpointMBean EndpointMBean

Introduction

In this page you can find the example usage for org.springframework.boot.actuate.endpoint.jmx EndpointMBean EndpointMBean.

Prototype

EndpointMBean(JmxOperationResponseMapper responseMapper, ClassLoader classLoader,
            ExposableJmxEndpoint endpoint) 

Source Link

Usage

From source file:org.springframework.boot.actuate.endpoint.jmx.JmxEndpointExporter.java

private ObjectName register(ExposableJmxEndpoint endpoint) {
    Assert.notNull(endpoint, "Endpoint must not be null");
    try {// ww w  .j av a  2s .c  o m
        ObjectName name = this.objectNameFactory.getObjectName(endpoint);
        EndpointMBean mbean = new EndpointMBean(this.responseMapper, this.classLoader, endpoint);
        this.mBeanServer.registerMBean(mbean, name);
        return name;
    } catch (MalformedObjectNameException ex) {
        throw new IllegalStateException("Invalid ObjectName for " + getEndpointDescription(endpoint), ex);
    } catch (Exception ex) {
        throw new MBeanExportException("Failed to register MBean for " + getEndpointDescription(endpoint), ex);
    }
}