servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r654679 - /servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
Date Fri, 09 May 2008 04:06:37 GMT
Author: ffang
Date: Thu May  8 21:06:37 2008
New Revision: 654679

URL: http://svn.apache.org/viewvc?rev=654679&view=rev
Log:
[SM-1341]remove org.apache.servicemix.jbi.messaging.NormalizedMessageImpl dependency for servicemix-cxf-se
to make it runable on smx4

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java?rev=654679&r1=654678&r2=654679&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/interceptors/AttachmentInInterceptor.java
Thu May  8 21:06:37 2008
@@ -17,11 +17,12 @@
 package org.apache.servicemix.cxfse.interceptors;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import javax.activation.DataHandler;
 import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
 
 import org.apache.cxf.attachment.AttachmentImpl;
 
@@ -29,7 +30,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
-import org.apache.servicemix.jbi.messaging.NormalizedMessageImpl;
+
 
 public class AttachmentInInterceptor extends AbstractPhaseInterceptor<Message> {
      
@@ -41,11 +42,11 @@
     public void handleMessage(Message message) {
         List<Attachment> attachmentList = new ArrayList<Attachment>();
         MessageExchange exchange = message.get(MessageExchange.class);
-        NormalizedMessageImpl norMessage = 
-            (NormalizedMessageImpl) exchange.getMessage("in");
-        Iterator<String> iter = norMessage.listAttachments();
-        while (iter.hasNext()) {
-            String id = iter.next();
+        NormalizedMessage norMessage = 
+            (NormalizedMessage) exchange.getMessage("in");
+        Set names = norMessage.getAttachmentNames();
+        for (Object obj : names) {
+            String id = (String)obj;
             DataHandler dh = norMessage.getAttachment(id);
             attachmentList.add(new AttachmentImpl(id, dh));
         }



Mime
View raw message