use of org.apache.cxf.management.counters.Counter in project cxf by apache.
the class AbstractMessageResponseTimeInterceptor method isServiceCounterEnabled.
protected boolean isServiceCounterEnabled(Exchange ex) {
Bus bus = ex.getBus();
CounterRepository counterRepo = bus.getExtension(CounterRepository.class);
if (counterRepo == null) {
return false;
}
ObjectName serviceCounterName = getServiceCounterName(ex);
Counter serviceCounter = counterRepo.getCounter(serviceCounterName);
// If serviceCounter is null, we need to wait ResponseTimeOutInterceptor to create it , hence set to true
return serviceCounter == null || serviceCounter.isEnabled();
}
Aggregations