Search in sources :

Example 1 with JmxExporter

use of com.predic8.membrane.core.jmx.JmxExporter in project service-proxy by membrane.

the class Router method initJmx.

private void initJmx() {
    if (beanFactory != null) {
        try {
            Object exporterObj = beanFactory.getBean(JmxExporter.JMX_EXPORTER_NAME);
            if (exporterObj != null) {
                JmxExporter exporter = (JmxExporter) exporterObj;
                String prefix = "org.membrane-soa:00=routers, name=";
                // exporter.removeBean(prefix + jmxRouterName);
                exporter.addBean(prefix + jmxRouterName, new JmxRouter(this, exporter));
            }
        } catch (NoSuchBeanDefinitionException ignored) {
        // If bean is not available, then dont init jmx
        }
    }
}
Also used : JmxExporter(com.predic8.membrane.core.jmx.JmxExporter) JmxRouter(com.predic8.membrane.core.jmx.JmxRouter) NoSuchBeanDefinitionException(org.springframework.beans.factory.NoSuchBeanDefinitionException)

Aggregations

JmxExporter (com.predic8.membrane.core.jmx.JmxExporter)1 JmxRouter (com.predic8.membrane.core.jmx.JmxRouter)1 NoSuchBeanDefinitionException (org.springframework.beans.factory.NoSuchBeanDefinitionException)1