Author: gnodet
Date: Wed Jun 18 13:19:23 2008
New Revision: 669277
URL: http://svn.apache.org/viewvc?rev=669277&view=rev
Log:
CXF-1658: The jbi transport should honor the sendSync flag so that xa transactions are handled
correctly in smx3
Modified:
cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Modified: cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java?rev=669277&r1=669276&r2=669277&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Wed Jun 18 13:19:23 2008
@@ -26,6 +26,7 @@
import java.util.logging.Logger;
import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.Fault;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.NormalizedMessage;
@@ -42,6 +43,8 @@
public class JBIDestinationOutputStream extends CachedOutputStream {
+ private static final String SEND_SYNC = "javax.jbi.messaging.sendSync";
+
private static final Logger LOG = LogUtils.getL7dLogger(JBIDestinationOutputStream.class);
private Message inMessage;
private Message outMessage;
@@ -119,12 +122,17 @@
}
LOG.fine(new org.apache.cxf.common.i18n.Message(
"POST.DISPATCH", LOG).toString());
- channel.send(xchng);
+ if (xchng.getStatus() == ExchangeStatus.ACTIVE
+ && Boolean.TRUE.equals(xchng.getProperty(SEND_SYNC))) {
+ channel.sendSync(xchng);
+ } else {
+ channel.send(xchng);
+ }
}
} catch (Exception ex) {
LOG.log(Level.SEVERE, new org.apache.cxf.common.i18n.Message(
"ERROR.SEND.MESSAGE", LOG).toString(), ex);
}
}
-
+
}
|