summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/assembly
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/assembly')
-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
/**