You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/03/04 08:14:19 UTC

svn commit: r749929 - /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java

Author: ffang
Date: Wed Mar  4 07:14:18 2009
New Revision: 749929

URL: http://svn.apache.org/viewvc?rev=749929&view=rev
Log:
[SMXCOMP-470]we need cache attachment earlier when use ws-addressing and mtom

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java?rev=749929&r1=749928&r2=749929&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java Wed Mar  4 07:14:18 2009
@@ -19,6 +19,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.cxf.attachment.LazyAttachmentCollection;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapBodyInfo;
 import org.apache.cxf.endpoint.Endpoint;
@@ -44,6 +45,7 @@
     }
 
     public void handleMessage(Message message) {
+        loadAttachments(message);
         if (isGET(message)) {
             return;
         }
@@ -93,6 +95,14 @@
         }
     }
 
+    private void loadAttachments(Message message) {
+        //get chance to cache the attachments
+        if (message.getAttachments() != null) {
+            LazyAttachmentCollection attachments = (LazyAttachmentCollection) message.getAttachments();
+            attachments.size();
+        }
+    }
+
     protected DepthXMLStreamReader getXMLStreamReader(Message message) {
         
         XMLStreamReader xr = message.getContent(XMLStreamReader.class);