tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1303313 - in /tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms: JMSBinding.java JMSBindingProcessor.java
Date Wed, 21 Mar 2012 08:51:22 GMT
Author: antelder
Date: Wed Mar 21 08:51:22 2012
New Revision: 1303313

URL: http://svn.apache.org/viewvc?rev=1303313&view=rev
Log:
TUSCANY-4024: Don't write out the response wireFormat when its defaulting to the request one

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
    tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java?rev=1303313&r1=1303312&r2=1303313&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
Wed Mar 21 08:51:22 2012
@@ -154,6 +154,7 @@ public class JMSBinding implements Bindi
     
     private WireFormat requestWireFormat;
     private WireFormat responseWireFormat;
+    private boolean responseWireFormatIsDefault;
     private OperationSelector operationSelector;
     private ExtensionType extensionType;
     private String jmsURI;
@@ -227,6 +228,14 @@ public class JMSBinding implements Bindi
         this.responseWireFormat = wireFormat;
     }    
     
+    public boolean isResponseWireFormatDefault() {
+        return responseWireFormatIsDefault;
+    }
+    
+    public void setResponseWireFormatIsDefault(boolean b) {
+        this.responseWireFormatIsDefault = b;
+    }    
+
     public OperationSelector getOperationSelector() {
         return operationSelector;
     }
@@ -983,6 +992,7 @@ public class JMSBinding implements Bindi
         // wire format
         if ( this.getRequestWireFormat().getClass() != binding.getRequestWireFormat().getClass())
return false;
         if ( this.getResponseWireFormat().getClass() != binding.getResponseWireFormat().getClass())
return false;
+        if ( this.isResponseWireFormatDefault() != binding.isResponseWireFormatDefault())
return false;
         
         // operation selector
         if ( this.getOperationSelector().getClass() != binding.getOperationSelector().getClass())
return false;

Modified: tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java?rev=1303313&r1=1303312&r2=1303313&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
Wed Mar 21 08:51:22 2012
@@ -255,14 +255,17 @@ public class JMSBindingProcessor extends
                 // may be overwritten be real wire format later
                 jmsBinding.setRequestWireFormat(new WireFormatJMSTextXML());
                 jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat());
+                jmsBinding.setResponseWireFormatIsDefault(true);
             } else if ("TextMessage".equalsIgnoreCase(messageProcessorName)) {
                 // may be overwritten be real wire format later
                 jmsBinding.setRequestWireFormat(new WireFormatJMSText());
                 jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat());
+                jmsBinding.setResponseWireFormatIsDefault(true);
             } else if ("ObjectMessage".equalsIgnoreCase(messageProcessorName)) {
                 // may be overwritten be real wire format later
                 jmsBinding.setRequestWireFormat(new WireFormatJMSObject());
                 jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat());
+                jmsBinding.setResponseWireFormatIsDefault(true);
             } else {
                 jmsBinding.setRequestMessageProcessorName(messageProcessorName);
                 jmsBinding.setResponseMessageProcessorName(messageProcessorName);
@@ -270,6 +273,7 @@ public class JMSBindingProcessor extends
                 // message processor
                 jmsBinding.setRequestWireFormat(new WireFormatJMSText());
                 jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat());
+                jmsBinding.setResponseWireFormatIsDefault(true);
             }
         }
 
@@ -391,6 +395,7 @@ public class JMSBindingProcessor extends
         // if no response wire format specific then assume the same as the request
         if (jmsBinding.getResponseWireFormat() == null){
             jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat());
+            jmsBinding.setResponseWireFormatIsDefault(true);
          }
 
         validate( jmsBinding, monitor );
@@ -1201,12 +1206,12 @@ public class JMSBindingProcessor extends
             
            writer.writeStartElement(Constants.SCA11_NS, "response");
 
-           if ((jmsBinding.getResponseWireFormat() != null) &&
+           if ((!jmsBinding.isResponseWireFormatDefault()) &&
+        		   (jmsBinding.getResponseWireFormat() != null) &&
                    !(jmsBinding.getResponseWireFormat() instanceof WireFormatJMSDefault)){
                    writeWireFormat(jmsBinding.getResponseWireFormat(), writer, context);
            }
-               
-          
+
            writeResponseDestinationProperties( jmsBinding, writer );       
            writeResponseConnectionFactoryProperties( jmsBinding, writer );        
            writeResponseActivationSpecProperties( jmsBinding, writer );



Mime
View raw message