diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-30 12:29:50 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-30 12:29:50 +0000 |
commit | 34766b4b32027392eb927557cdb6230061803e7c (patch) | |
tree | a64214a0e0c9bbb3bdbdc4f0b0dd941d33f3f0b6 /branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms | |
parent | 1936c49187913656f82d289f5e72bdf536c142bf (diff) |
TUSCANY-2996 - Add support for wrapSingle attribute that, when set true, ensures that single parameters are wrapped in an array on the wire. When set false single parameters will not be wrapped on the wire. Multiple parameters will always be wrapped.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@770201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms')
2 files changed, 21 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObject.java b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObject.java index 7e39f696bd..a485d2b5ec 100644 --- a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObject.java +++ b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObject.java @@ -32,6 +32,10 @@ import org.apache.tuscany.sca.assembly.WireFormat; public class WireFormatJMSObject implements WireFormat { public static final QName WIRE_FORMAT_JMS_BYTES_QNAME = new QName(Constants.SCA10_TUSCANY_NS, "wireFormat.jmsObject"); + public static final String WIRE_FORMAT_JMS_OBJECT_WRAP_SINGLE_ATTR = "wrapSingle"; + + private boolean wrappedSingleInput = false; + public QName getSchemaName() { return WIRE_FORMAT_JMS_BYTES_QNAME; } @@ -42,4 +46,12 @@ public class WireFormatJMSObject implements WireFormat { public void setUnresolved(boolean unresolved) { } + + public void setWrappedSingleInput(boolean wrappedSingleInput) { + this.wrappedSingleInput = wrappedSingleInput; + } + + public boolean isWrappedSingleInput() { + return wrappedSingleInput; + } } diff --git a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProcessor.java b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProcessor.java index 806b713931..d38701d29b 100644 --- a/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProcessor.java +++ b/branches/sca-java-1.x/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsobject/WireFormatJMSObjectProcessor.java @@ -52,7 +52,13 @@ public class WireFormatJMSObjectProcessor extends BaseStAXArtifactProcessor impl public WireFormatJMSObject read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { WireFormatJMSObject wireFormat = new WireFormatJMSObject(); - + + String wrappedSingleInput = reader.getAttributeValue(null, WireFormatJMSObject.WIRE_FORMAT_JMS_OBJECT_WRAP_SINGLE_ATTR); + if (wrappedSingleInput != null && wrappedSingleInput.length() > 0) { + if ("true".equalsIgnoreCase(wrappedSingleInput)) { + wireFormat.setWrappedSingleInput(true); + } + } return wireFormat; } @@ -64,6 +70,8 @@ public class WireFormatJMSObjectProcessor extends BaseStAXArtifactProcessor impl getArtifactType().getNamespaceURI()); writer.writeNamespace("tuscany", Constants.SCA10_TUSCANY_NS); + writer.writeAttribute(WireFormatJMSObject.WIRE_FORMAT_JMS_OBJECT_WRAP_SINGLE_ATTR, String.valueOf(wireFormat.isWrappedSingleInput())); + writer.writeEndElement(); } |