From fd9e2c5c3d1e8112c129190082340ed728cda996 Mon Sep 17 00:00:00 2001 From: slaws Date: Tue, 18 Aug 2009 15:01:46 +0000 Subject: Push component name to the monitor context and sort out some incorrect indentation git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@805438 13f79535-47bb-0310-9956-ffa450edef68 --- .../impl/ComponentConfigurationBuilderImpl.java | 100 +++++++++++---------- 1 file changed, 53 insertions(+), 47 deletions(-) (limited to 'java') diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java index 7688ebe0a7..ebd1b8da8e 100644 --- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java +++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java @@ -100,51 +100,55 @@ public class ComponentConfigurationBuilderImpl extends BaseBuilderImpl implement private void configureComponents(Composite composite, String uri, Definitions definitions, Monitor monitor) { String parentURI = uri; - // Process nested composites recursively - for (Component component : composite.getComponents()) { - - // Initialize component URI - String componentURI; - if (parentURI == null) { - componentURI = component.getName(); - } else { - componentURI = URI.create(parentURI + '/').resolve(component.getName()).toString(); - } - component.setURI(componentURI); - - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - try { - monitor.pushContext("Composite: " + ((Composite)implementation).getURI()); - - // Process nested composite - configureComponents((Composite)implementation, componentURI, definitions, monitor); - - } finally { - monitor.popContext(); - } // end try - } - } // end for - - // Initialize service bindings - List compositeServices = composite.getServices(); - for (Service service : compositeServices) { - // Set default binding names - - // Create default SCA binding - attachSCABinding(service, definitions); - } - - // Initialize reference bindings - for (Reference reference : composite.getReferences()) { - // Create default SCA binding - attachSCABinding(reference, definitions); - } - - // Initialize all component services and references - Map components = new HashMap(); - for (Component component : composite.getComponents()) { - + // Process nested composites recursively + for (Component component : composite.getComponents()) { + + // Initialize component URI + String componentURI; + if (parentURI == null) { + componentURI = component.getName(); + } else { + componentURI = URI.create(parentURI + '/').resolve(component.getName()).toString(); + } + component.setURI(componentURI); + + Implementation implementation = component.getImplementation(); + if (implementation instanceof Composite) { + try { + monitor.pushContext("Composite: " + ((Composite)implementation).getURI()); + + // Process nested composite + configureComponents((Composite)implementation, componentURI, definitions, monitor); + + } finally { + monitor.popContext(); + } // end try + } + } // end for + + // Initialize service bindings + List compositeServices = composite.getServices(); + for (Service service : compositeServices) { + // Set default binding names + + // Create default SCA binding + attachSCABinding(service, definitions); + } + + // Initialize reference bindings + for (Reference reference : composite.getReferences()) { + // Create default SCA binding + attachSCABinding(reference, definitions); + } + + // Initialize all component services and references + Map components = new HashMap(); + for (Component component : composite.getComponents()) { + + + monitor.pushContext("Component: " + component.getName()); + + try { // Index all components and check for duplicates if (components.containsKey(component.getName())) { error(monitor, "DuplicateComponentName", component, composite.getName().toString(), component.getName()); @@ -207,8 +211,10 @@ public class ComponentConfigurationBuilderImpl extends BaseBuilderImpl implement // Create default SCA binding attachSCABinding(componentReference, definitions); } - } - + } finally { + monitor.popContext(); + } + } } // end method /** -- cgit v1.2.3