From 31f71e8e078644469dd2ed93d5873fc1050062e4 Mon Sep 17 00:00:00 2001 From: slaws Date: Fri, 6 Jan 2012 12:35:01 +0000 Subject: TUSCANY-3932 - First part of this JIRA is to remove some inconsistencies in the way that callbacks are handled now. See JIRA for more comments on this first change. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1228150 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/assembly/xml/SCABindingProcessor.java | 24 ++++++++++++++++++++++ .../sca/assembly/xml/TestSCABindingImpl.java | 24 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) (limited to 'sca-java-2.x/trunk/modules/assembly-xml') diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java index bbc812582e..f0cbcc669f 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java @@ -51,6 +51,8 @@ import org.apache.tuscany.sca.policy.PolicySubject; public class SCABindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor { private static final String NAME = "name"; private static final String URI = "uri"; + private static final String DELEGATE_BINDING_TYPE = "delegateBindingType"; + private static final String DELEGATE_BINDING_URI = "delegateBindingURI"; private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200912"; private static final String BINDING_SCA = "binding.sca"; @@ -100,6 +102,18 @@ public class SCABindingProcessor extends BaseStAXArtifactProcessor implements St if (uri != null) { scaBinding.setURI(uri); } + + // Read delegate binding type + String delegateBindingType = getString(reader, DELEGATE_BINDING_TYPE); + if (delegateBindingType != null) { + scaBinding.setDelegateBindingType(delegateBindingType); + } + + // Read delegate binding URI + String delegateBindingURI = getURIString(reader, DELEGATE_BINDING_URI); + if (delegateBindingURI != null) { + scaBinding.setDelegateBindingURI(delegateBindingURI); + } // Read any sub-elements boolean endFound = false; @@ -145,6 +159,16 @@ public class SCABindingProcessor extends BaseStAXArtifactProcessor implements St writer.writeAttribute(URI, scaBinding.getURI()); } + // Write delegate binding type + if (scaBinding.getDelegateBindingType() != null) { + writer.writeAttribute(DELEGATE_BINDING_TYPE, scaBinding.getDelegateBindingType()); + } + + // Write delegate binding URI + if (scaBinding.getDelegateBindingURI() != null) { + writer.writeAttribute(DELEGATE_BINDING_URI, scaBinding.getDelegateBindingURI()); + } + // write wireFormat extensionProcessor.write(scaBinding.getRequestWireFormat(), writer, context); diff --git a/sca-java-2.x/trunk/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java b/sca-java-2.x/trunk/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java index f83a2ebd14..3845fff14a 100644 --- a/sca-java-2.x/trunk/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java +++ b/sca-java-2.x/trunk/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestSCABindingImpl.java @@ -159,4 +159,28 @@ public class TestSCABindingImpl implements SCABinding, PolicySubject { public void setOperationSelector(OperationSelector operationSelector) { } + + @Override + public String getDelegateBindingType() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setDelegateBindingType(String delegateBindingType) { + // TODO Auto-generated method stub + + } + + @Override + public String getDelegateBindingURI() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setDelegateBindingURI(String delegateBindingURI) { + // TODO Auto-generated method stub + + } } -- cgit v1.2.3