cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1036401 - in /cxf/branches/2.3.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/endpoint/ systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/ systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/resources/
Date Thu, 18 Nov 2010 11:00:22 GMT
Author: ffang
Date: Thu Nov 18 11:00:21 2010
New Revision: 1036401

URL: http://svn.apache.org/viewvc?rev=1036401&view=rev
Log:
Merged revisions 1036397 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1036397 | ffang | 2010-11-18 18:53:33 +0800 (四, 18 11 2010) | 1 line
  
  [CXF-3132]asynchronous client can't get correct error if non-runtimeexcpetion happen
........

Added:
    cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
      - copied unchanged from r1036397, cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java
    cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/HugeResponseInterceptor.java
      - copied unchanged from r1036397, cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/HugeResponseInterceptor.java
    cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/resources/stack_overflow_rs.xml
      - copied unchanged from r1036397, cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/resources/stack_overflow_rs.xml
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1036401&r1=1036400&r2=1036401&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
Thu Nov 18 11:00:21 2010
@@ -730,7 +730,31 @@ public class ClientImpl
             } else if (message.getContent(Exception.class) != null) {
                 outFaultObserver.onMessage(message);
             } else {
-                chain.doIntercept(message);
+                callback = message.getExchange().get(ClientCallback.class);
+
+                if (callback != null && !isPartialResponse(message)) {
+                    try {
+                        chain.doIntercept(message);
+                    } catch (Throwable error) {
+                        //so that asyn callback handler get chance to 
+                        //handle non-runtime exceptions
+                        message.getExchange().setInMessage(message);
+                        Map<String, Object> resCtx = CastUtils
+                                .cast((Map<?, ?>) message.getExchange()
+                                        .getOutMessage().get(
+                                                Message.INVOCATION_CONTEXT));
+                        resCtx = CastUtils.cast((Map<?, ?>) resCtx
+                                .get(RESPONSE_CONTEXT));
+                        if (resCtx != null) {
+                            responseContext.put(Thread.currentThread(), resCtx);
+                        }
+                        callback.handleException(resCtx, error);
+
+                    }
+                } else {
+                    chain.doIntercept(message);
+                }
+                 
             }
 
             callback = message.getExchange().get(ClientCallback.class);



Mime
View raw message