summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/assembly/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-22 21:02:03 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-22 21:02:03 +0000
commit2013ed478edae048c634f059027a0e784ea8c5de (patch)
treec5a0879da6a0b8ffff6978125b8bebd71b11eca2 /java/sca/modules/assembly/src
parentecf9531818c689e51c9354902f35572e0becef31 (diff)
TUSCANY-3150 make the context a little more interesting in the example.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@796877 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly/src')
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java60
1 files changed, 33 insertions, 27 deletions
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
index dd62cbb11a..fe5487921f 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
@@ -87,39 +87,45 @@ public class ComponentReferenceWireBuilderImpl extends BaseBuilderImpl implement
// Validate that references are wired or promoted, according
// to their multiplicity
- for (ComponentReference componentReference : componentReferences.values()) {
- if (!ReferenceConfigurationUtil.validateMultiplicityAndTargets(componentReference.getMultiplicity(),
- componentReference.getTargets(),
- componentReference.getBindings())) {
- if (componentReference.getTargets().isEmpty()) {
-
- // No warning if the reference is promoted out of the current composite
- boolean promoted = false;
- for (Reference reference : composite.getReferences()) {
- CompositeReference compositeReference = (CompositeReference)reference;
- if (compositeReference.getPromotedReferences().contains(componentReference)) {
- promoted = true;
- break;
+ for (Component component: components.values()){
+ monitor.pushContext(component.getName());
+ for (ComponentReference componentReference : component.getReferences()) {
+ monitor.pushContext(componentReference.getName());
+ if (!ReferenceConfigurationUtil.validateMultiplicityAndTargets(componentReference.getMultiplicity(),
+ componentReference.getTargets(),
+ componentReference.getBindings())) {
+ if (componentReference.getTargets().isEmpty()) {
+
+ // No warning if the reference is promoted out of the current composite
+ boolean promoted = false;
+ for (Reference reference : composite.getReferences()) {
+ CompositeReference compositeReference = (CompositeReference)reference;
+ if (compositeReference.getPromotedReferences().contains(componentReference)) {
+ promoted = true;
+ break;
+ }
}
- }
- if (!promoted && !componentReference.isForCallback()) {
- warning(monitor,
- "ReferenceWithoutTargets",
- composite,
- composite.getName().toString(),
- componentReference.getName());
- }
- } else {
+ if (!promoted && !componentReference.isForCallback()) {
+ warning(monitor,
+ "ReferenceWithoutTargets",
+ composite,
+ composite.getName().toString(),
+ componentReference.getName());
+ }
+ } else {
// ---------------------------
// TUSCANY-3132 first example of updated error handling
- Monitor.error(monitor,
- this,
- "assembly-validation-messages",
- "TooManyReferenceTargets",
- componentReference.getName());
+ Monitor.error(monitor,
+ this,
+ "assembly-validation-messages",
+ "TooManyReferenceTargets",
+ componentReference.getName());
// ---------------------------
+ }
}
+ monitor.popContext();
}
+ monitor.popContext();
}
// Finally clear the original reference target lists as we now have