cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/6] git commit: [CXF-5840]:ResponseTimeCounter counts the one-way fault message twice
Date Mon, 07 Jul 2014 06:44:06 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b246f4379 -> 9a5231905


[CXF-5840]:ResponseTimeCounter counts the one-way fault message twice


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2d2a45a7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2d2a45a7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2d2a45a7

Branch: refs/heads/master
Commit: 2d2a45a7e5051dad207a02ccd1cc3e3206fb3dd1
Parents: 5588092
Author: Jim Ma <ema@apache.org>
Authored: Mon Jul 7 11:28:17 2014 +0800
Committer: Jim Ma <ema@apache.org>
Committed: Mon Jul 7 14:43:38 2014 +0800

----------------------------------------------------------------------
 .../ResponseTimeMessageInvokerInterceptor.java         | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2d2a45a7/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptor.java
b/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptor.java
index f04d498..2181f2c 100644
--- a/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptor.java
+++ b/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptor.java
@@ -39,16 +39,21 @@ public class ResponseTimeMessageInvokerInterceptor extends AbstractMessageRespon
     }
 
     public void handleMessage(Message message) throws Fault {
-        message.getInterceptorChain().add(new ResponseTimeMessageInvokerEndingInteceptor());
+        Exchange ex = message.getExchange();
+        if (Boolean.TRUE.equals((Boolean)ex.get("org.apache.cxf.management.counter.enabled")))
{
+            message.getInterceptorChain().add(new ResponseTimeMessageInvokerEndingInteceptor());
+        }
 
     }
 
     @Override
     public void handleFault(Message message) {
         Exchange ex = message.getExchange();
-        ex.put(FaultMode.class, message.get(FaultMode.class));
-        if (ex.isOneWay() && !isClient(message)) {
-            endHandlingMessage(ex);
+        if (ex.get("org.apache.cxf.management.counter.enabled") != null) {
+            ex.put(FaultMode.class, message.get(FaultMode.class));
+            if (ex.isOneWay() && !isClient(message)) {
+                endHandlingMessage(ex);
+            }
         }
     }
 


Mime
View raw message