cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clecl...@apache.org
Subject svn commit: r893011 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/interceptor/ management/src/main/java/org/apache/cxf/management/interceptor/
Date Mon, 21 Dec 2009 22:08:21 GMT
Author: cleclerc
Date: Mon Dec 21 22:08:21 2009
New Revision: 893011

URL: http://svn.apache.org/viewvc?rev=893011&view=rev
Log:
[CXF-2540] JMX ResponseTimeFeature does not count client side exceptions
- add FaultMode entry to the exchange in ClientFaultConverter
- Change ResponseTimeMessageInInterceptor phase registration from RECEIVE to POST_LOGICAL
- Register ResponseTimeMessageInInterceptor in the InFaultInterceptor list

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeFeature.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java?rev=893011&r1=893010&r2=893011&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java Mon
Dec 21 22:08:21 2009
@@ -43,6 +43,7 @@
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.XPathUtils;
+import org.apache.cxf.message.FaultMode;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -79,6 +80,22 @@
             processFaultDetail(fault, msg);
             setStackTrace(fault, msg);
         }
+
+        FaultMode faultMode = FaultMode.UNCHECKED_APPLICATION_FAULT;
+
+        // Check if the raised exception is declared in the WSDL or by the JAX-RS resource
+        Method m = msg.getExchange().get(Method.class);
+        if (m != null) {
+            Exception e = msg.getContent(Exception.class);
+            for (Class<?> cl : m.getExceptionTypes()) {
+                if (cl.isInstance(e)) {
+                    faultMode = FaultMode.CHECKED_APPLICATION_FAULT;
+                    break;
+                }
+            }
+        }
+        
+        msg.getExchange().put(FaultMode.class, faultMode);
     }
 
     protected void processFaultDetail(Fault fault, Message msg) {

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeFeature.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeFeature.java?rev=893011&r1=893010&r2=893011&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeFeature.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeFeature.java
Mon Dec 21 22:08:21 2009
@@ -35,6 +35,7 @@
     @Override
     protected void initializeProvider(InterceptorProvider provider, Bus bus) {
         provider.getInInterceptors().add(IN);
+        provider.getInFaultInterceptors().add(IN);
         provider.getInInterceptors().add(INVOKER);
         provider.getOutInterceptors().add(OUT);
         

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInInterceptor.java?rev=893011&r1=893010&r2=893011&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInInterceptor.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/ResponseTimeMessageInInterceptor.java
Mon Dec 21 22:08:21 2009
@@ -28,7 +28,7 @@
 public class ResponseTimeMessageInInterceptor extends AbstractMessageResponseTimeInterceptor
{
     
     public ResponseTimeMessageInInterceptor() {
-        super(Phase.RECEIVE);
+        super(Phase.POST_LOGICAL);
     }
     
     public void handleMessage(Message message) throws Fault {



Mime
View raw message