cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject git commit: [CXF-5840]:ResponseTimeCounter counts the one-way fault message twice
Date Wed, 02 Jul 2014 09:53:47 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e0036b70c -> b6d3e1531


[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/b6d3e153
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b6d3e153
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b6d3e153

Branch: refs/heads/master
Commit: b6d3e153187af3c89b6e3efa2c50979636c2ca45
Parents: e0036b7
Author: Jim Ma <ema@apache.org>
Authored: Wed Jul 2 17:53:03 2014 +0800
Committer: Jim Ma <ema@apache.org>
Committed: Wed Jul 2 17:53:03 2014 +0800

----------------------------------------------------------------------
 .../ResponseTimeMessageInvokerInterceptor.java  | 26 ++++++++++++++------
 ...sponseTimeMessageInvokerInterceptorTest.java |  6 +++--
 2 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b6d3e153/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 9a270bd..f04d498 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
@@ -31,20 +31,18 @@ import org.apache.cxf.phase.Phase;
  * handler by the binging interceptor  
  * */
 public class ResponseTimeMessageInvokerInterceptor extends AbstractMessageResponseTimeInterceptor
{
-    
+
     public ResponseTimeMessageInvokerInterceptor() {
         super(Phase.INVOKE);
         // this interceptor should be add before the serviceInvokerInterceptor
         addBefore(ServiceInvokerInterceptor.class.getName());
     }
-    
+
     public void handleMessage(Message message) throws Fault {
-        Exchange ex = message.getExchange();
-        if (ex.isOneWay() && !isClient(message)) {
-            setOneWayMessage(ex);
-        }
+        message.getInterceptorChain().add(new ResponseTimeMessageInvokerEndingInteceptor());
+
     }
-    
+
     @Override
     public void handleFault(Message message) {
         Exchange ex = message.getExchange();
@@ -53,4 +51,18 @@ public class ResponseTimeMessageInvokerInterceptor extends AbstractMessageRespon
             endHandlingMessage(ex);
         }
     }
+
+    class ResponseTimeMessageInvokerEndingInteceptor extends AbstractMessageResponseTimeInterceptor
{
+        public ResponseTimeMessageInvokerEndingInteceptor() {
+            super(Phase.INVOKE);
+            addAfter(ServiceInvokerInterceptor.class.getName());
+        }
+
+        public void handleMessage(Message message) throws Fault {
+            Exchange ex = message.getExchange();
+            if (ex.isOneWay() && !isClient(message)) {
+                setOneWayMessage(ex);
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/b6d3e153/rt/management/src/test/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptorTest.java
----------------------------------------------------------------------
diff --git a/rt/management/src/test/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptorTest.java
b/rt/management/src/test/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptorTest.java
index 69a91d8..66809ee 100644
--- a/rt/management/src/test/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptorTest.java
+++ b/rt/management/src/test/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInvokerInterceptorTest.java
@@ -20,14 +20,16 @@
 package org.apache.cxf.management.interceptor;
 
 import org.apache.cxf.management.counters.MessageHandlingTimeRecorder;
-
 import org.apache.cxf.message.Message;
 import org.easymock.EasyMock;
 import org.junit.Test;
 
 public class ResponseTimeMessageInvokerInterceptorTest extends AbstractMessageResponseTestBase
{
 
-    private ResponseTimeMessageInvokerInterceptor rtmii = new ResponseTimeMessageInvokerInterceptor();
+    private ResponseTimeMessageInvokerInterceptor invokerInterceptor = 
+        new ResponseTimeMessageInvokerInterceptor();
+    private ResponseTimeMessageInvokerInterceptor.ResponseTimeMessageInvokerEndingInteceptor
rtmii = 
+        invokerInterceptor.new ResponseTimeMessageInvokerEndingInteceptor();
     
     @Test
     public void testServerOneWayMessageIn() {


Mime
View raw message