Index: src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBIAdapter.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBIAdapter.java,v retrieving revision 1.13 diff -u -r1.13 JBIAdapter.java --- src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBIAdapter.java 4 Jul 2007 15:20:20 -0000 1.13 +++ src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBIAdapter.java 12 Jun 2008 19:09:43 -0000 @@ -44,6 +44,8 @@ import com.sun.xml.ws.api.server.WSEndpoint; import com.sun.logging.LogDomains; +import java.util.HashMap; +import java.util.Map; import java.util.logging.Logger; import java.util.logging.Level; import javax.jbi.messaging.MessageExchange; @@ -112,6 +114,8 @@ public void handle() { Packet packet = new Packet(); packet.setMessage(con.receiveRequest()); + packet.invocationProperties.putAll(con.getInboundMsgProperties()); + try { packet = head.process(packet,con,this); } catch(Exception e) { @@ -125,6 +129,9 @@ postInvoke(); Message responseMessage = packet.getMessage(); try { + Map props = new HashMap(); + props.putAll(packet.invocationProperties); + con.setOutboundMsgProperties(props); con.sendResponse(responseMessage); } catch(Exception e) { logger.log(Level.SEVERE, e.getMessage(), e); Index: src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBITransportPipe.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBITransportPipe.java,v retrieving revision 1.10 diff -u -r1.10 JBITransportPipe.java --- src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBITransportPipe.java 5 May 2007 05:30:26 -0000 1.10 +++ src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/JBITransportPipe.java 12 Jun 2008 19:09:43 -0000 @@ -45,6 +45,8 @@ import javax.xml.namespace.QName; import java.net.URL; +import java.util.HashMap; +import java.util.Map; /** * This is the main Pipe that is used by JAX-WS client runtime to sendRequest the @@ -90,6 +92,9 @@ new NMRClientConnection(wsdlLocation, service, endpointName, operation, isOneWay); con.initialize(); + Map prop = new HashMap(); + prop.putAll(request.invocationProperties); + con.setOutboundMsgProperties(prop); con.sendRequest(request.getMessage()); Message respMsg = con.receiveResponse(); @@ -97,7 +102,11 @@ if(!isOneWay) { con.sendStatus(); } - + + prop = con.getInboundMsgProperties(); + if (prop != null){ + reply.invocationProperties.putAll(prop); + } return reply; } catch(Exception wex) { RuntimeException ex = new RuntimeException(wex.getMessage()); Index: src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRClientConnection.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRClientConnection.java,v retrieving revision 1.14 diff -u -r1.14 NMRClientConnection.java --- src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRClientConnection.java 25 May 2007 08:19:39 -0000 1.14 +++ src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRClientConnection.java 12 Jun 2008 19:09:43 -0000 @@ -48,6 +48,7 @@ import javax.jbi.messaging.ExchangeStatus; import javax.xml.namespace.QName; import java.net.URL; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import javax.jbi.messaging.DeliveryChannel; import javax.jbi.messaging.MessageExchange; @@ -68,7 +69,8 @@ private QName operation; private MessageExchange me = null; private MessageExchangeTransport meTransport; - + private Map outboundProps; + private static ConcurrentHashMap emdCache = new ConcurrentHashMap(11,0.75f,4); @@ -94,8 +96,6 @@ JavaEEServiceEngineContext.getInstance(). getDeliveryChannel(); String key = DescriptorEndpointInfo.getDEIKey(service, endpointName); DescriptorEndpointInfo dei = EndpointRegistry.getInstance().getJBIEndpts().get(key); - QName service = (dei == null)? this.service:dei.getServiceName(); - String endpointName = (dei == null)? this.endpointName:dei.getEndpointName(); // Create MessageExchange MessageExchangeFactory factory = @@ -137,7 +137,19 @@ return emd; } + public void setOutboundMsgProperties(Map props){ + this.outboundProps = props; + } + + public Map getInboundMsgProperties(){ + if (meTransport != null){ + return meTransport.getInboundMsgProps(); + } + return null; + } + public void sendRequest(Message abstractMessage) throws Exception { + meTransport.setOutboundMsgProps(this.outboundProps); meTransport.send(abstractMessage, getEndpointMetaData()); } Index: src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRServerConnection.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRServerConnection.java,v retrieving revision 1.18 diff -u -r1.18 NMRServerConnection.java --- src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRServerConnection.java 5 May 2007 05:30:26 -0000 1.18 +++ src/java/com/sun/enterprise/jbi/serviceengine/bridge/transport/NMRServerConnection.java 12 Jun 2008 19:09:43 -0000 @@ -43,6 +43,7 @@ import com.sun.xml.ws.api.message.Packet; import com.sun.xml.ws.api.server.WSEndpoint; import java.security.Principal; +import java.util.Map; import java.util.logging.Logger; import javax.jbi.messaging.MessageExchange; @@ -55,6 +56,7 @@ private MessageExchange me; private ServiceEngineEndpoint endpt; private MessageExchangeTransport meTransport; + private Map outboundProps; private static Logger logger = LogDomains.getLogger(LogDomains.SERVER_LOGGER); @@ -72,12 +74,24 @@ } public void sendResponse(Message abstractMessage) throws Exception { + meTransport.setOutboundMsgProps(outboundProps); meTransport.send(abstractMessage, endpt.getEndpointMetaData()); } public void handleException(Exception e) { meTransport.sendError(e); } + + public void setOutboundMsgProperties(Map props){ + this.outboundProps = props; + } + + public Map getInboundMsgProperties(){ + if (meTransport != null){ + return meTransport.getInboundMsgProps(); + } + return null; + } //TODO: Implement these methods public Principal getUserPrincipal(Packet request) { Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOnly.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOnly.java,v retrieving revision 1.8 diff -u -r1.8 ConsumerInOnly.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOnly.java 5 May 2007 05:30:26 -0000 1.8 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOnly.java 12 Jun 2008 19:09:43 -0000 @@ -77,6 +77,7 @@ public void send(NormalizedMessage request) throws Exception { this.msg = request; + setMessageProperties(request, this.outboundMessageProps); me.setInMessage(request); send(); } Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOut.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOut.java,v retrieving revision 1.8 diff -u -r1.8 ConsumerInOut.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOut.java 5 May 2007 05:30:26 -0000 1.8 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/ConsumerInOut.java 12 Jun 2008 19:09:43 -0000 @@ -82,6 +82,7 @@ public void send(NormalizedMessage message) throws Exception { this.msg = message; + setMessageProperties(message, this.outboundMessageProps); me.setInMessage(message); send(); } @@ -145,6 +146,7 @@ emd.getOutputPartBindings(operationName)); unwrappedMessage.unwrap(); + this.inboundMessageProps = getMessageProperties(normalizedMessage); } } catch(Exception ex) { logger.log(Level.WARNING, ex.getMessage() + Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransport.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransport.java,v retrieving revision 1.3 diff -u -r1.3 MessageExchangeTransport.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransport.java 5 May 2007 05:30:26 -0000 1.3 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransport.java 12 Jun 2008 19:09:43 -0000 @@ -47,6 +47,7 @@ import com.sun.enterprise.jbi.serviceengine.util.soap.EndpointMetaData; import com.sun.xml.ws.api.message.Message; +import java.util.Map; import javax.jbi.messaging.ExchangeStatus; import javax.jbi.messaging.NormalizedMessage; import javax.jbi.messaging.MessageExchange; @@ -70,6 +71,13 @@ public void sendError(Exception exception); + // Message going to NMR + public void setInboundMsgProps(Map props); + public Map getInboundMsgProps(); + // Message coming from NMR + public void setOutboundMsgProps(Map props); + public Map getOutboundMsgProps(); + /** * The following methods are required by the old code path. */ Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransportImpl.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransportImpl.java,v retrieving revision 1.4 diff -u -r1.4 MessageExchangeTransportImpl.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransportImpl.java 4 Jul 2007 15:20:21 -0000 1.4 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/MessageExchangeTransportImpl.java 12 Jun 2008 19:09:43 -0000 @@ -49,6 +49,9 @@ import com.sun.enterprise.jbi.serviceengine.handlers.JBIHandler; import com.sun.enterprise.jbi.serviceengine.handlers.JBIHandlerFactory; import com.sun.logging.LogDomains; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; @@ -65,9 +68,12 @@ MessageExchange me; protected NormalizedMessage msg = null; + protected Map inboundMessageProps = null; + protected Map outboundMessageProps = null; + protected static final Logger logger = LogDomains.getLogger(LogDomains.SERVER_LOGGER); - + protected MessageExchangeTransportImpl(MessageExchange me) { this.me = me; } @@ -157,4 +163,47 @@ // throw new ServiceEngineException(e); } } + + protected void setMessageProperties(NormalizedMessage nm, Map props){ + if ((props != null) && (nm != null)){ + Iterator itr = props.keySet().iterator(); + String key = null; + while (itr.hasNext()){ + key = itr.next(); + nm.setProperty(key, props.get(key)); + } + } + } + + protected Map getMessageProperties(NormalizedMessage nm){ + Map ret = null; + + if (nm != null){ + ret = new HashMap(); + Iterator itr = nm.getPropertyNames().iterator(); + String key = null; + while (itr.hasNext()){ + key = itr.next(); + ret.put(key, nm.getProperty(key)); + } + } + + return ret; + } + + public void setInboundMsgProps(Map props){ + this.inboundMessageProps = props; + } + + public void setOutboundMsgProps(Map props){ + this.outboundMessageProps = props; + } + + public Map getInboundMsgProps(){ + return this.inboundMessageProps; + } + + public Map getOutboundMsgProps(){ + return this.outboundMessageProps; + } } Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOnly.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOnly.java,v retrieving revision 1.10.6.1 diff -u -r1.10.6.1 ProviderInOnly.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOnly.java 25 Mar 2008 09:06:31 -0000 1.10.6.1 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOnly.java 12 Jun 2008 19:09:43 -0000 @@ -108,6 +108,7 @@ emd.getInputPartBindings(operationName)); unwrappedMessage.unwrap(); + this.inboundMessageProps = getMessageProperties(normalizedMessage); } } catch(Exception ex) { logger.log(Level.INFO, ex.getMessage()); Index: src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOut.java =================================================================== RCS file: /cvs/glassfish/appserv-addons/jbi/src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOut.java,v retrieving revision 1.7 diff -u -r1.7 ProviderInOut.java --- src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOut.java 5 May 2007 05:30:27 -0000 1.7 +++ src/java/com/sun/enterprise/jbi/serviceengine/comm/ProviderInOut.java 12 Jun 2008 19:09:43 -0000 @@ -106,6 +106,7 @@ emd.getInputPartBindings(operationName)); unwrappedMessage.unwrap(); + this.inboundMessageProps = getMessageProperties(normalizedMessage); } } catch(Exception ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); @@ -119,6 +120,7 @@ if(response instanceof Fault) { me.setFault((Fault)response); } else { + setMessageProperties(response, this.outboundMessageProps); me.setOutMessage(response); } this.msg = response;