Example usage for org.springframework.jmx.access MBeanProxyFactoryBean setServer

List of usage examples for org.springframework.jmx.access MBeanProxyFactoryBean setServer

Introduction

In this page you can find the example usage for org.springframework.jmx.access MBeanProxyFactoryBean setServer.

Prototype

public void setServer(MBeanServerConnection server) 

Source Link

Document

Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.

Usage

From source file:org.springframework.batch.sample.launch.RemoteLauncherTests.java

private static Object getMBean(MBeanServerConnectionFactoryBean connectionFactory, String objectName,
        Class<?> interfaceType) throws MalformedObjectNameException {
    MBeanProxyFactoryBean factory = new MBeanProxyFactoryBean();
    factory.setObjectName(objectName);//from ww w.j a v  a  2  s.  c  om
    factory.setProxyInterface(interfaceType);
    factory.setServer(connectionFactory.getObject());
    factory.afterPropertiesSet();
    return factory.getObject();
}