All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openl.rules.ruleservice.spring.CXFManagement Maven / Gradle / Ivy

package org.openl.rules.ruleservice.spring;

import org.apache.cxf.Bus;
import org.apache.cxf.management.counters.CounterRepository;
import org.apache.cxf.management.jmx.InstrumentationManagerImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import org.openl.spring.config.ConditionalOnEnable;

/**
 * Registering of CXF MBeans.
 *
 * @author Yury Molchan
 * @see CXF JMX Integration
 */
@Configuration
@ConditionalOnEnable("ruleservice.jmx.enabled")
public class CXFManagement {

    @Bean
    CounterRepository counters(Bus cxf) {
        CounterRepository counterRepository = new CounterRepository();
        counterRepository.setBus(cxf);
        return counterRepository;
    }

    @Bean
    InstrumentationManagerImpl manager(Bus cxf) {
        InstrumentationManagerImpl manager = new InstrumentationManagerImpl();
        manager.setBus(cxf);
        manager.setEnabled(true);
        manager.setUsePlatformMBeanServer(true);
        manager.init();
        return manager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy