diff options
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java | 65 |
1 files changed, 31 insertions, 34 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 dab5fb3d5e..cbade8d520 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 @@ -539,40 +539,37 @@ public class ComponentPolicyBuilderImpl { } if (!intentMatched){ - - // Reference side intents can still be resolved by the service binding, so we can only issue a - // warning here. - if ( subject instanceof EndpointReference ) { - warning(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString()); - } 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 { - // The ExtensionType on the subject only has the binding name. The one in the system - // definitions will have the mayProvide/alwaysProvides values - if (type.getType().getLocalPart().startsWith("implementation")) { - for ( ExtensionType et : context.getDefinitions().getImplementationTypes() ) { - if ( type.getType().equals(et.getType()) ) { - type = et; - } - } - } else { - 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()); - } - } - } + + // 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 ) { + // The ExtensionType on the subject only has the binding name. The one in the system + // definitions will have the mayProvide/alwaysProvides values + if (type.getType().getLocalPart().startsWith("implementation")) { + for ( ExtensionType et : context.getDefinitions().getImplementationTypes() ) { + if ( type.getType().equals(et.getType()) ) { + type = et; + } + } + } else { + for ( ExtensionType et : context.getDefinitions().getBindingTypes() ) { + if ( type.getType().equals(et.getType()) ) { + type = et; + } + } + } + } + + if ( type == null || !type.getAlwaysProvidedIntents().contains(intent) && !type.getMayProvidedIntents().contains(intent)) { + // Reference side intents can still be resolved by the service binding, so we can only issue a + // warning here. + if ( subject instanceof EndpointReference ) { + warning(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString()); + } else { + error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString()); + } + } } } } |