* <p>
* <b>Performance measurement:</b></br>
* Supports measuring the request processing time at the client side. Setting "{@value #PROP_KEY_MEASURE_DURATION}"
- * as system parameter enables the measurement. To make the measurements appear in the log, the log <code>Level</code>
- * for this class needs to be set to at least {@link org.apache.log4j.Level#INFO}
+ * as system parameter enables the measurement. To make the measurements appear for each request in the log, the logging <code>Level</code>
+ * for <code>HttpInvokerProxyFactoryBean</code> needs to be set to at least {@link org.apache.log4j.Level#INFO}. Otherwise the duration is
+ * only reported in case of errors.
*
*
* @author a.kohlbecker
if(measureDuration){
startTime = System.currentTimeMillis();
}
- RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation);
- if(measureDuration){
- double duration = System.currentTimeMillis() - startTime;
- logger.info(getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
+ try {
+ RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation);
+ if(measureDuration){
+ double duration = System.currentTimeMillis() - startTime;
+ logger.info(getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
+ }
+ return result;
+ } catch(Exception e) {
+ if(measureDuration){
+ double duration = System.currentTimeMillis() - startTime;
+ logger.error("(" + e.getClass().getName() + ": \"" + e.getMessage() + "\") interrupts " + getServiceUrl() + "#" + invocation.getMethodName() + " after [" + duration + " ms]");
+ }
+ throw e;
}
- return result;
}
/**