summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 15:01:46 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-08-18 15:01:46 +0000
commitfd9e2c5c3d1e8112c129190082340ed728cda996 (patch)
tree189161cd0e6ebf52bdb4288d87027a1447fb3de7 /java
parent16a134b8a4cf9391a97316e2737b77465d2fc93b (diff)
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
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentConfigurationBuilderImpl.java100
1 files changed, 53 insertions, 47 deletions
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<Service> 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<String, Component> components = new HashMap<String, Component>();
- 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<Service> 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<String, Component> components = new HashMap<String, Component>();
+ 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
/**