cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r654011 - in /cxf/trunk/rt/transports/jbi/src: main/java/org/apache/cxf/transport/jbi/JBIDestination.java main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java
Date Wed, 07 May 2008 07:09:32 GMT
Author: ffang
Date: Wed May  7 00:09:32 2008
New Revision: 654011

URL: http://svn.apache.org/viewvc?rev=654011&view=rev
Log:
[CXF-1573]JBIDestinationOutputStream should copy attachments into NormalizedMessage to support
outbound attachments

Modified:
    cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
    cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
    cxf/trunk/rt/transports/jbi/src/test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java

Modified: cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java?rev=654011&r1=654010&r2=654011&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
(original)
+++ cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
Wed May  7 00:09:32 2008
@@ -118,7 +118,7 @@
             DeliveryChannel dc = channel;
             message.put(MessageExchange.class, inMessage.get(MessageExchange.class));
             message.setContent(OutputStream.class,
-                               new JBIDestinationOutputStream(inMessage, dc));
+                               new JBIDestinationOutputStream(inMessage, message, dc));
         }        
 
         protected Logger getLogger() {

Modified: cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java?rev=654011&r1=654010&r2=654011&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
(original)
+++ cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Wed May  7 00:09:32 2008
@@ -43,12 +43,15 @@
 
     private static final Logger LOG = LogUtils.getL7dLogger(JBIDestinationOutputStream.class);
     private Message inMessage;
+    private Message outMessage;
     private DeliveryChannel channel;
     
     public JBIDestinationOutputStream(Message m, 
+                               Message outM,
                                DeliveryChannel dc) {
         super();
         inMessage = m;
+        outMessage = outM;
         channel = dc;
     }
     
@@ -97,8 +100,8 @@
                 } else {
                     NormalizedMessage msg = xchng.createMessage();
                     //copy attachments
-                    if (inMessage.getAttachments() != null) {
-                        for (Attachment att : inMessage.getAttachments()) {
+                    if (outMessage != null && outMessage.getAttachments() != null)
{
+                        for (Attachment att : outMessage.getAttachments()) {
                             msg.addAttachment(att.getId(), att
                                     .getDataHandler());
                         }

Modified: cxf/trunk/rt/transports/jbi/src/test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jbi/src/test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java?rev=654011&r1=654010&r2=654011&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jbi/src/test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java
(original)
+++ cxf/trunk/rt/transports/jbi/src/test/java/org/apache/cxf/transport/jbi/JBIDestinationTest.java
Wed May  7 00:09:32 2008
@@ -57,7 +57,7 @@
         channel.send(messageExchange);
         EasyMock.replay(channel);
         
-        JBIDestinationOutputStream jbiOS = new JBIDestinationOutputStream(message, channel);
+        JBIDestinationOutputStream jbiOS = new JBIDestinationOutputStream(message, null,
channel);
         
         //Create array of more than what is in threshold in CachedOutputStream, 
         //though the threshold in CachedOutputStream should be made protected 



Mime
View raw message