Author: ffang
Date: Wed Jul 22 09:59:34 2009
New Revision: 796655
URL: http://svn.apache.org/viewvc?rev=796655&view=rev
Log:
Merged revisions 796648 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r796648 | ffang | 2009-07-22 17:50:31 +0800 (δΈ‰, 22 7 2009) | 1 line
[CXF-2350]JBIConduitOutputStream should copy properties between JBI
NormalizedMessage and cxf message invocation context
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java?rev=796655&r1=796654&r2=796655&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIConduitOutputStream.java
Wed Jul 22 09:59:34 2009
@@ -21,8 +21,12 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.Serializable;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
import java.util.logging.Logger;
import javax.jbi.messaging.DeliveryChannel;
@@ -123,19 +127,39 @@
xchng.setInterfaceName(interfaceName);
xchng.setOperation(bop.getName());
+ //copy context
+ Map<String, Object> invocationContext =
+ (Map<String, Object>)
message.get(Message.INVOCATION_CONTEXT);
+ if (invocationContext != null) {
+ for (Map.Entry<String, Object> ent : ((Map<String,
Object>) invocationContext
+ .get("RequestContext")).entrySet()) {
+ // check if value is Serializable, and if value is Map
+ // or collection,
+ // just exclude it since the entry of it may not be
+ // Serializable as well
+ if (ent.getValue() instanceof Serializable
+ && !(ent.getValue() instanceof Map)
+ && !(ent.getValue() instanceof Collection)) {
+ inMsg.setProperty(ent.getKey(), ent.getValue());
+ }
+ }
+ }
xchng.setMessage(inMsg, "in");
LOG.info("sending message");
if (!isOneWay) {
channel.sendSync(xchng);
NormalizedMessage outMsg = ((InOut)xchng).getOutMessage();
Source content = null;
+ Set normalizedMessageProps = null;
if (outMsg != null) {
content = outMsg.getContent();
+ normalizedMessageProps = outMsg.getPropertyNames();
} else {
if (((InOut)xchng).getFault() == null) {
throw xchng.getError();
}
content = ((InOut)xchng).getFault().getContent();
+ normalizedMessageProps =
((InOut)xchng).getFault().getPropertyNames();
}
Message inMessage = new MessageImpl();
message.getExchange().setInMessage(inMessage);
@@ -148,6 +172,14 @@
inMessage.put(MessageExchange.class, xchng);
+ if (normalizedMessageProps != null) {
+
+ for (Object name : normalizedMessageProps) {
+ inMessage.put((String) name, outMsg
+ .getProperty((String) name));
+
+ }
+ }
conduit.getMessageObserver().onMessage(inMessage);
xchng.setStatus(ExchangeStatus.DONE);