diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-26 04:37:27 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-26 04:37:27 +0000 |
commit | a1cb50c30445cd5a1266351fe7729ff3dcdf2767 (patch) | |
tree | 9355febb1d55624927883a9cb27b6bd88bcfd863 /sca-java-2.x/trunk/modules/builder/src/main/java/org | |
parent | 418adac2f50cacb5c36542830da94054a677ed86 (diff) |
Check constrained types for the qualifiable parent of a qualified intent
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@979155 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder/src/main/java/org')
-rw-r--r-- | sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java index e908122861..5db7ca78a3 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java +++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java @@ -110,7 +110,7 @@ public class ComponentPolicyBuilderImpl { // The intents are merged and the exclusion check will be done after for (Intent intent : subject.getRequiredIntents()) { if (!policySubject.getRequiredIntents().contains(intent)){ - if (intentType != null) { + if ((intent.getType() != null) && (intentType != null) ) { if (intent.getType().equals(intentType)){ policySubject.getRequiredIntents().add(intent); } @@ -392,7 +392,7 @@ public class ComponentPolicyBuilderImpl { subject.getRequiredIntents().remove(i); subject.getRequiredIntents().add(i.getDefaultQualifiedIntent()); } - } + } } protected void resolveAndNormalize(PolicySubject subject, BuilderContext context) { Definitions definitions = context.getDefinitions(); @@ -469,7 +469,11 @@ public class ComponentPolicyBuilderImpl { if(extensionType != null){ List<Intent> copy = new ArrayList<Intent>(intents); for (Intent i : copy) { - if (i.getConstrainedTypes().size() > 0){ + List<ExtensionType> constrainedTypes = i.getConstrainedTypes(); + if (( constrainedTypes.size() == 0 ) && ( i.getQualifiableIntent() != null ) ) + constrainedTypes = i.getQualifiableIntent().getConstrainedTypes(); + + if (constrainedTypes.size() > 0){ boolean constraintFound = false; for (ExtensionType constrainedType : i.getConstrainedTypes()){ if (constrainedType.getType().equals(extensionType.getType()) || |