Search in sources :

Example 1 with MBeanProxyFactoryBean

use of org.springframework.jmx.access.MBeanProxyFactoryBean in project opennms by OpenNMS.

the class JmxDaemonStatusDao method buildProxy.

private ServiceDaemon buildProxy(ObjectName mBeanName) {
    MBeanProxyFactoryBean mBeanProxyFactoryBean = new MBeanProxyFactoryBean();
    try {
        mBeanProxyFactoryBean.setObjectName(mBeanName.getCanonicalName());
    } catch (MalformedObjectNameException e) {
        throw new JmxObjectNameException("Object name '" + mBeanName.getCanonicalName() + "' was malformed!", e);
    }
    mBeanProxyFactoryBean.setProxyInterface(ServiceDaemon.class);
    mBeanProxyFactoryBean.afterPropertiesSet();
    return (ServiceDaemon) mBeanProxyFactoryBean.getObject();
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) MBeanProxyFactoryBean(org.springframework.jmx.access.MBeanProxyFactoryBean) ServiceDaemon(org.opennms.netmgt.model.ServiceDaemon)

Aggregations

MalformedObjectNameException (javax.management.MalformedObjectNameException)1 ServiceDaemon (org.opennms.netmgt.model.ServiceDaemon)1 MBeanProxyFactoryBean (org.springframework.jmx.access.MBeanProxyFactoryBean)1