use of org.apache.cxf.message.FaultMode in project cxf by apache.
the class CodahaleMetricsContext method stop.
public void stop(long timeInNS, long inSize, long outSize, Exchange ex) {
totals.update(timeInNS, TimeUnit.NANOSECONDS);
if (inSize != -1) {
incomingData.mark(inSize);
}
if (outSize != -1) {
outgoingData.mark(outSize);
}
FaultMode fm = ex.get(FaultMode.class);
if (fm == null && ex.getOutFaultMessage() != null) {
fm = ex.getOutFaultMessage().get(FaultMode.class);
}
if (fm == null && ex.getInMessage() != null) {
fm = ex.getInMessage().get(FaultMode.class);
}
if (fm != null) {
switch(fm) {
case CHECKED_APPLICATION_FAULT:
checkedApplicationFaults.update(timeInNS, TimeUnit.NANOSECONDS);
break;
case UNCHECKED_APPLICATION_FAULT:
uncheckedApplicationFaults.update(timeInNS, TimeUnit.NANOSECONDS);
break;
case RUNTIME_FAULT:
runtimeFaults.update(timeInNS, TimeUnit.NANOSECONDS);
break;
case LOGICAL_RUNTIME_FAULT:
logicalRuntimeFaults.update(timeInNS, TimeUnit.NANOSECONDS);
break;
default:
}
}
inFlight.dec();
}
use of org.apache.cxf.message.FaultMode in project cxf by apache.
the class MetricsMessageClientOutInterceptor method handleFault.
public void handleFault(Message message) {
if (isRequestor(message)) {
Exception ex = message.getContent(Exception.class);
if (ex != null) {
FaultMode fm = message.getExchange().get(FaultMode.class);
message.getExchange().put(FaultMode.class, FaultMode.RUNTIME_FAULT);
stop(message);
message.getExchange().put(FaultMode.class, fm);
} else {
stop(message);
}
}
}
Aggregations