You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/06/02 05:14:45 UTC
svn commit: r780922 -
/servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java
Author: ffang
Date: Tue Jun 2 03:14:45 2009
New Revision: 780922
URL: http://svn.apache.org/viewvc?rev=780922&view=rev
Log:
[SMX4-290]revert unwilling commit
Modified:
servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java
Modified: servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java?rev=780922&r1=780921&r2=780922&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java (original)
+++ servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestination.java Tue Jun 2 03:14:45 2009
@@ -85,7 +85,8 @@
* @return the inbuilt backchannel
*/
protected Conduit getInbuiltBackChannel(Message inMessage) {
- return null;
+ return new BackChannelConduit(EndpointReferenceUtils.getAnonymousEndpointReference(),
+ inMessage);
}
public void shutdown() {
@@ -119,5 +120,43 @@
throw new ServiceMixException(ex);
}
}
-
+
+
+ protected class BackChannelConduit extends AbstractConduit {
+
+ protected Message inMessage;
+ protected NMRDestination nmrDestination;
+
+ BackChannelConduit(EndpointReferenceType ref, Message message) {
+ super(ref);
+ inMessage = message;
+ }
+
+ /**
+ * Register a message observer for incoming messages.
+ *
+ * @param observer the observer to notify on receipt of incoming
+ */
+ public void setMessageObserver(MessageObserver observer) {
+ // shouldn't be called for a back channel conduit
+ }
+
+ /**
+ * Send an outbound message, assumed to contain all the name-value
+ * mappings of the corresponding input message (if any).
+ *
+ * @param message the message to be sent.
+ */
+ public void prepare(Message message) throws IOException {
+ // setup the message to be send back
+ Channel dc = channel;
+ message.put(Exchange.class, inMessage.get(Exchange.class));
+ message.setContent(OutputStream.class, new NMRDestinationOutputStream(inMessage, dc));
+ }
+
+ protected Logger getLogger() {
+ return LOG;
+ }
+ }
+
}