cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r469821 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/main/java/org...
Date Wed, 01 Nov 2006 08:38:16 GMT
Author: tli
Date: Wed Nov  1 00:38:16 2006
New Revision: 469821

URL: http://svn.apache.org/viewvc?view=rev&rev=469821
Log:
add check to avoid duplicate Fault wrap for nested doIntercept call

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java
Wed Nov  1 00:38:16 2006
@@ -19,14 +19,19 @@
 
 package org.apache.cxf.service.model;
 
+import java.util.List;
+
 public class BindingMessageInfo extends AbstractPropertiesHolder {
 
     MessageInfo msg;
     BindingOperationInfo op;
+    private List<MessagePartInfo> messageParts;
+    
     
-    BindingMessageInfo(MessageInfo m, BindingOperationInfo boi) {
+    protected BindingMessageInfo(MessageInfo m, BindingOperationInfo boi) {
         op = boi;
         msg = m;
+        messageParts = msg.getMessageParts();
     }
     
     public MessageInfo getMessageInfo() {
@@ -35,5 +40,13 @@
     
     public BindingOperationInfo getBindingOperation() {
         return op;
+    }
+
+    public List<MessagePartInfo> getMessageParts() {
+        return messageParts;
+    }
+
+    public void setMessageParts(List<MessagePartInfo> messageParts) {
+        this.messageParts = messageParts;
     }
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -51,8 +51,12 @@
         
         // Calling for soap out interceptor
         if (!message.getInterceptorChain().doIntercept(message) 
-            && message.getContent(Exception.class) != null) {            
-            throw new Fault(message.getContent(Exception.class));            
+            && message.getContent(Exception.class) != null) {
+            if (message.getContent(Exception.class) instanceof Fault) {
+                throw (Fault)message.getContent(Exception.class);
+            } else {
+                throw new Fault(message.getContent(Exception.class));
+            }
         }
         // Set back the output stream
         message.setContent(OutputStream.class, os);        

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -88,7 +88,11 @@
             //message.getInterceptorChain().doIntercept(message);            
             if (!message.getInterceptorChain().doInterceptInSubChain(message) 
                 && message.getContent(Exception.class) != null) {
-                throw new Fault(message.getContent(Exception.class));
+                if (message.getContent(Exception.class) instanceof Fault) {
+                    throw (Fault)message.getContent(Exception.class);
+                } else {
+                    throw new Fault(message.getContent(Exception.class));
+                }
             }
             xtw.writeEndElement();            
             // Write Envelop end element

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -58,7 +58,11 @@
                 conduit.close(message);
             } else {
                 if (message.getContent(Exception.class) != null) {
-                    throw new Fault(message.getContent(Exception.class));
+                    if (message.getContent(Exception.class) instanceof Fault) {
+                        throw (Fault)message.getContent(Exception.class);
+                    } else {
+                        throw new Fault(message.getContent(Exception.class));
+                    }
                 }
             }
         } catch (IOException ex) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -74,7 +74,11 @@
             }
             
             if (!result && message.getContent(Exception.class) != null) {
-                throw new Fault(message.getContent(Exception.class));
+                if (message.getContent(Exception.class) instanceof Fault) {
+                    throw (Fault)message.getContent(Exception.class);
+                } else {
+                    throw new Fault(message.getContent(Exception.class));
+                }
             }            
         } catch (XMLStreamException e) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC", BUNDLE),
e);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -63,7 +63,11 @@
                 xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
                 if (!message.getInterceptorChain().doIntercept(message) 
                         && message.getContent(Exception.class) != null) {       
            
-                    throw new Fault(message.getContent(Exception.class));               
    
+                    if (message.getContent(Exception.class) instanceof Fault) {
+                        throw (Fault)message.getContent(Exception.class);
+                    } else {
+                        throw new Fault(message.getContent(Exception.class));
+                    }                    
                 }
                 xmlWriter.writeEndElement();
             } catch (XMLStreamException e) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Wed Nov  1 00:38:16 2006
@@ -90,7 +90,11 @@
 
             if (message.getInterceptorChain().doInterceptInSubChain(message)
                 && message.getContent(Exception.class) != null) {
-                throw new Fault(message.getContent(Exception.class));
+                if (message.getContent(Exception.class) instanceof Fault) {
+                    throw (Fault)message.getContent(Exception.class);
+                } else {
+                    throw new Fault(message.getContent(Exception.class));
+                }
             }
 
             super.handleMessage(message);

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?view=diff&rev=469821&r1=469820&r2=469821
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Wed Nov  1 00:38:16 2006
@@ -37,6 +37,7 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.InterceptorChain;
 import org.apache.cxf.interceptor.OutgoingChainSetupInterceptor;
 import org.apache.cxf.message.Exchange;
@@ -330,7 +331,14 @@
                     partialResponse.setInterceptorChain(chain);
                     exchange.setConduit(backChannel);
                     
-                    partialResponse.getInterceptorChain().doIntercept(partialResponse);
+                    if (!partialResponse.getInterceptorChain().doIntercept(partialResponse)

+                            && partialResponse.getContent(Exception.class) != null)
{
+                        if (partialResponse.getContent(Exception.class) instanceof Fault)
{
+                            throw (Fault)partialResponse.getContent(Exception.class);
+                        } else {
+                            throw new Fault(partialResponse.getContent(Exception.class));
+                        }
+                    }
                     
                     partialResponse.getInterceptorChain().reset();
                     exchange.setConduit(null);



Mime
View raw message