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

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

Introduction

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

Prototype

public void setObjectName(Object objectName) throws MalformedObjectNameException 

Source Link

Document

Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String .

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