use of org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor 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
}
use of org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor 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);
}
}
}
Aggregations