diff options
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java index d34d9c8638..412481886f 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java @@ -246,6 +246,9 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { Message msgContext = ThreadMessageContext.getMessageContext(); + // Deal with header information that needs to be copied from the message context to the new message... + transferMessageHeaders( msg, msgContext); + ThreadMessageContext.setMessageContext(msg); try { @@ -260,6 +263,17 @@ public class JDKInvocationHandler implements InvocationHandler, Serializable { ThreadMessageContext.setMessageContext(msgContext); } } + + /** + * Transfer relevant header information from the old message (incoming) to the new message (outgoing) + * @param newMsg + * @param oldMsg + */ + private void transferMessageHeaders( Message newMsg, Message oldMsg ) { + if( oldMsg == null ) return; + // For the present, simply copy all the headers + if( !oldMsg.getHeaders().isEmpty() ) newMsg.getHeaders().putAll( oldMsg.getHeaders() ); + } // end transferMessageHeaders /** * @return the callableReference |