diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-02 22:34:09 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-02 22:34:09 +0000 |
commit | 8dc96644f69ab8efd45f19b1478dceedb9b6b0a1 (patch) | |
tree | 3b2d9afb670d49716a0df02f50ef3b162c1b6e0f | |
parent | 0171c408cd3745ec12ab191d05309ba245236172 (diff) |
TUSCANY-3075 - don't write out the services and references generated to handle callbacks.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@781191 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java | 174 |
1 files changed, 89 insertions, 85 deletions
diff --git a/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java index 2297b06a2d..f34adbc581 100644 --- a/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ b/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java @@ -703,95 +703,99 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt // Write <service> elements for (ComponentService service : component.getServices()) { - writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), - policyProcessor.writePolicies(service)); - - //write extended attributes - this.writeExtendedAttributes(writer, service, extensionAttributeProcessor); - - // Write service interface - extensionProcessor.write(service.getInterfaceContract(), writer); - - // Write bindings - for (Binding binding : service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write <callback> element - if (service.getCallback() != null) { - Callback callback = service.getCallback(); - writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback)); - - //write extended attributes - this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor); - - // Write bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extension : callback.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extension : service.getExtensions()) { - extensionProcessor.write(extension, writer); - } - - writeEnd(writer); + if (service.isCallback() == false){ + writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), + policyProcessor.writePolicies(service)); + + //write extended attributes + this.writeExtendedAttributes(writer, service, extensionAttributeProcessor); + + // Write service interface + extensionProcessor.write(service.getInterfaceContract(), writer); + + // Write bindings + for (Binding binding : service.getBindings()) { + extensionProcessor.write(binding, writer); + } + + // Write <callback> element + if (service.getCallback() != null) { + Callback callback = service.getCallback(); + writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback)); + + //write extended attributes + this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor); + + // Write bindings + for (Binding binding : callback.getBindings()) { + extensionProcessor.write(binding, writer); + } + + // Write extensions + for (Object extension : callback.getExtensions()) { + extensionProcessor.write(extension, writer); + } + + writeEnd(writer); + } + + // Write extensions + for (Object extension : service.getExtensions()) { + extensionProcessor.write(extension, writer); + } + + writeEnd(writer); + } } // Write <reference> elements for (ComponentReference reference : component.getReferences()) { - writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()), - new XAttr(AUTOWIRE, reference.getAutowire()), - writeMultiplicity(reference), - writeTargets(reference), - policyProcessor.writePolicies(reference)); - - //write extended attributes - this.writeExtendedAttributes(writer, reference, extensionAttributeProcessor); - - // Write reference interface - extensionProcessor.write(reference.getInterfaceContract(), writer); - - // Write bindings - for (Binding binding : reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write callback - if (reference.getCallback() != null) { - Callback callback = reference.getCallback(); - writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback)); - - //write extended attributes - this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor); - - // Write callback bindings - for (Binding binding : callback.getBindings()) { - extensionProcessor.write(binding, writer); - } - - // Write extensions - for (Object extensions : callback.getExtensions()) { - extensionProcessor.write(extensions, writer); - } - - writeEnd(writer); - } - - // Write extensions - for (Object extensions : reference.getExtensions()) { - extensionProcessor.write(extensions, writer); - } - - writeEnd(writer); + if (reference.isCallback() == false){ + writeStart(writer, REFERENCE, new XAttr(NAME, reference.getName()), + new XAttr(AUTOWIRE, reference.getAutowire()), + writeMultiplicity(reference), + writeTargets(reference), + policyProcessor.writePolicies(reference)); + + //write extended attributes + this.writeExtendedAttributes(writer, reference, extensionAttributeProcessor); + + // Write reference interface + extensionProcessor.write(reference.getInterfaceContract(), writer); + + // Write bindings + for (Binding binding : reference.getBindings()) { + extensionProcessor.write(binding, writer); + } + + // Write callback + if (reference.getCallback() != null) { + Callback callback = reference.getCallback(); + writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback)); + + //write extended attributes + this.writeExtendedAttributes(writer, callback, extensionAttributeProcessor); + + // Write callback bindings + for (Binding binding : callback.getBindings()) { + extensionProcessor.write(binding, writer); + } + + // Write extensions + for (Object extensions : callback.getExtensions()) { + extensionProcessor.write(extensions, writer); + } + + writeEnd(writer); + } + + // Write extensions + for (Object extensions : reference.getExtensions()) { + extensionProcessor.write(extensions, writer); + } + + writeEnd(writer); + } } // Write <property> elements |