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

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

Introduction

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

Prototype

@Override
    @Nullable
    public Object getObject() 

Source Link

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  w  ww.j  a v a2 s  . c o m
    factory.setProxyInterface(interfaceType);
    factory.setServer(connectionFactory.getObject());
    factory.afterPropertiesSet();
    return factory.getObject();
}