camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1183580 - in /camel/branches/camel-2.8.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/
Date Sat, 15 Oct 2011 01:27:32 GMT
Author: dkulp
Date: Sat Oct 15 01:27:31 2011
New Revision: 1183580

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

........
  r1183577 | dkulp | 2011-10-14 21:25:12 -0400 (Fri, 14 Oct 2011) | 1 line
  
  Update to remove the part types "up front" instead of per request.
........

Removed:
    camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/RemoveClassTypeInterceptor.java
Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java

Propchange: camel/branches/camel-2.8.x/
            ('svn:mergeinfo' removed)

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java?rev=1183580&r1=1183579&r2=1183580&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/feature/PayLoadDataFormatFeature.java
Sat Oct 15 01:27:31 2011
@@ -19,12 +19,18 @@ package org.apache.camel.component.cxf.f
 import java.util.ArrayList;
 import java.util.Collection;
 
+import javax.xml.transform.Source;
+
 import org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor;
-import org.apache.camel.component.cxf.interceptors.RemoveClassTypeInterceptor;
 import org.apache.cxf.Bus;
+import org.apache.cxf.binding.Binding;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.interceptor.ClientFaultConverter;
+import org.apache.cxf.service.model.BindingMessageInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,20 +51,58 @@ public class PayLoadDataFormatFeature ex
     public void initialize(Client client, Bus bus) {
         removeFaultInInterceptorFromClient(client);
         client.getEndpoint().getBinding().getInInterceptors().add(new ConfigureDocLitWrapperInterceptor(true));
-        client.getEndpoint().getBinding().getInInterceptors().add(new RemoveClassTypeInterceptor());
+        resetPartTypes(client.getEndpoint().getBinding());
     }
 
+
     @Override
     public void initialize(Server server, Bus bus) {
         server.getEndpoint().getBinding().getInInterceptors().add(new ConfigureDocLitWrapperInterceptor(true));
-        server.getEndpoint().getBinding().getInInterceptors().add(new RemoveClassTypeInterceptor());
+        resetPartTypes(server.getEndpoint().getBinding());
     }
 
     @Override
     protected Logger getLogger() {
         return LOG;
     }
+    
+    private void resetPartTypes(Binding bop2) {
+        for (BindingOperationInfo bop : bop2.getBindingInfo().getOperations()) {
+            resetPartTypes(bop);
+        }
+    }
 
+    private void resetPartTypes(BindingOperationInfo bop) {
+        if (bop.isUnwrapped()) {
+            bop = bop.getWrappedOperation();
+        }
+        if (bop.isUnwrappedCapable()) {
+            resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getInput());
+            resetPartTypeClass(bop.getWrappedOperation().getOperationInfo().getOutput());
+            resetPartTypeClass(bop.getWrappedOperation().getInput());
+            resetPartTypeClass(bop.getWrappedOperation().getOutput());
+        } else {
+            resetPartTypeClass(bop.getOperationInfo().getInput());
+            resetPartTypeClass(bop.getOperationInfo().getOutput());
+            resetPartTypeClass(bop.getInput());
+            resetPartTypeClass(bop.getOutput());
+        }
+    }
+    
+    protected void resetPartTypeClass(BindingMessageInfo bmi) {
+        if (bmi != null) {
+            for (MessagePartInfo part : bmi.getMessageParts()) {
+                part.setTypeClass(null);
+            }     
+        }
+    }
+    protected void resetPartTypeClass(MessageInfo msgInfo) {
+        if (msgInfo != null) {
+            for (MessagePartInfo part : msgInfo.getMessageParts()) {
+                part.setTypeClass(null);
+            }     
+        }
+    }
     private void removeFaultInInterceptorFromClient(Client client) {
         removeInterceptors(client.getInFaultInterceptors(), REMOVING_FAULT_IN_INTERCEPTORS);
         removeInterceptors(client.getEndpoint().getService().getInFaultInterceptors(), REMOVING_FAULT_IN_INTERCEPTORS);



Mime
View raw message