Search in sources :

Example 1 with ResponseTimeMessageOutInterceptor

use of org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor in project cxf by apache.

the class CounterRepository method registerInterceptorsToBus.

void registerInterceptorsToBus() {
    ResponseTimeMessageInInterceptor in = new ResponseTimeMessageInInterceptor();
    ResponseTimeMessageInvokerInterceptor invoker = new ResponseTimeMessageInvokerInterceptor();
    ResponseTimeMessageOutInterceptor out = new ResponseTimeMessageOutInterceptor();
    bus.getInInterceptors().add(in);
    bus.getInInterceptors().add(invoker);
    bus.getOutInterceptors().add(out);
    bus.getOutFaultInterceptors().add(out);
    bus.setExtension(this, CounterRepository.class);
// create CounterRepositroyMoniter to writer the counter log
// if the service is stopped or removed, the counters should remove itself
}
Also used : ResponseTimeMessageOutInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor) ResponseTimeMessageInInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor) ResponseTimeMessageInvokerInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageInvokerInterceptor)

Example 2 with ResponseTimeMessageOutInterceptor

use of org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor in project jbossws-cxf by jbossws.

the class BusHolder method setCXFManagement.

protected static void setCXFManagement(Bus bus, Map<String, String> props) {
    if (props != null && !props.isEmpty()) {
        final String p = props.get(Constants.CXF_MANAGEMENT_ENABLED);
        if ("true".equalsIgnoreCase(p) || "1".equalsIgnoreCase(p)) {
            InstrumentationManagerExtImpl instrumentationManagerImpl = new InstrumentationManagerExtImpl();
            instrumentationManagerImpl.setBus(bus);
            instrumentationManagerImpl.setEnabled(true);
            instrumentationManagerImpl.init();
            instrumentationManagerImpl.initMBeanServer();
            bus.setExtension(instrumentationManagerImpl, InstrumentationManager.class);
            CounterRepository couterRepository = new CounterRepository();
            couterRepository.setBus(bus);
            final String installRespTimeInterceptors = props.get(Constants.CXF_MANAGEMENT_INSTALL_RESPONSE_TIME_INTERCEPTORS);
            if (installRespTimeInterceptors == null || "true".equalsIgnoreCase(installRespTimeInterceptors) || "1".equalsIgnoreCase(installRespTimeInterceptors)) {
                ResponseTimeMessageInInterceptor in = new ResponseTimeMessageInInterceptor();
                ResponseTimeMessageInvokerInterceptor invoker = new ResponseTimeMessageInvokerInterceptor();
                ResponseTimeMessageOutInterceptor out = new ResponseTimeMessageOutInterceptor();
                bus.getInInterceptors().add(in);
                bus.getInInterceptors().add(invoker);
                bus.getOutInterceptors().add(out);
            }
            bus.setExtension(couterRepository, CounterRepository.class);
        }
    }
}
Also used : ResponseTimeMessageOutInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor) InstrumentationManagerExtImpl(org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl) ResponseTimeMessageInInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor) CounterRepository(org.apache.cxf.management.counters.CounterRepository) ResponseTimeMessageInvokerInterceptor(org.apache.cxf.management.interceptor.ResponseTimeMessageInvokerInterceptor)

Aggregations

ResponseTimeMessageInInterceptor (org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor)2 ResponseTimeMessageInvokerInterceptor (org.apache.cxf.management.interceptor.ResponseTimeMessageInvokerInterceptor)2 ResponseTimeMessageOutInterceptor (org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor)2 CounterRepository (org.apache.cxf.management.counters.CounterRepository)1 InstrumentationManagerExtImpl (org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl)1