summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-07-15 17:34:38 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-07-15 17:34:38 +0000
commitc96796e771ebe8055c32b765d2a0e52d0ad14418 (patch)
tree020ca744f3ed9df8ab272234791631bd67509831 /sca-java-2.x/trunk/modules
parent04c6f646cf7eb5fc4f9d859b583a4dbd349e84f2 (diff)
Use binding type from system definitions to obtain mayProvide/alwaysProvide values
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@964503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java19
1 files changed, 16 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 09d37bb463..e908122861 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
@@ -532,10 +532,23 @@ public class ComponentPolicyBuilderImpl {
} else {
// Need to check the ExtensionType to see if the intent is provided there. If not, throw an error
ExtensionType type = subject.getExtensionType();
- if ( type == null )
- error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
- else if ( !type.getAlwaysProvidedIntents().contains(intent) && !type.getMayProvidedIntents().contains(intent))
+
+
+ if ( type == null ) {
error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
+ } else {
+ // The ExtensionType on the subject only has the binding name. The one in the system
+ // definitions will have the mayProvide/alwaysProvides values
+ for ( ExtensionType et : context.getDefinitions().getBindingTypes() ) {
+ if ( type.getType().equals(et.getType()) ) {
+ type = et;
+ }
+ }
+
+ if ( !type.getAlwaysProvidedIntents().contains(intent) && !type.getMayProvidedIntents().contains(intent)) {
+ error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
+ }
+ }
}
}
}