diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-21 08:51:22 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-21 08:51:22 +0000 |
commit | 7072333cfe55d987d94ca5e4af20c9dd76e5af6b (patch) | |
tree | f9e54516bf67ba2aac00414e21155d21794e0ef0 /sca-java-2.x/trunk/modules/binding-jms | |
parent | c2e791e0fc951d1b4fda773a67709a6eaa3ca0bf (diff) |
TUSCANY-4024: Don't write out the response wireFormat when its defaulting to the request one
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1303313 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jms')
2 files changed, 18 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java index 7d91df8e09..fa57ec9fcc 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java @@ -154,6 +154,7 @@ public class JMSBinding implements Binding, PolicySubject, OperationsConfigurato 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 Binding, PolicySubject, OperationsConfigurato 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 Binding, PolicySubject, OperationsConfigurato // 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; diff --git a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java index 46db552fbe..697ee1aac1 100644 --- a/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java +++ b/sca-java-2.x/trunk/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java @@ -255,14 +255,17 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St // 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 BaseStAXArtifactProcessor implements St // message processor jmsBinding.setRequestWireFormat(new WireFormatJMSText()); jmsBinding.setResponseWireFormat(jmsBinding.getRequestWireFormat()); + jmsBinding.setResponseWireFormatIsDefault(true); } } @@ -391,6 +395,7 @@ public class JMSBindingProcessor extends BaseStAXArtifactProcessor implements St // 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 BaseStAXArtifactProcessor implements St 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 ); |