Return-Path: X-Original-To: apmail-tuscany-commits-archive@www.apache.org Delivered-To: apmail-tuscany-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A43227D32 for ; Thu, 1 Dec 2011 16:46:30 +0000 (UTC) Received: (qmail 60411 invoked by uid 500); 1 Dec 2011 16:46:30 -0000 Delivered-To: apmail-tuscany-commits-archive@tuscany.apache.org Received: (qmail 60373 invoked by uid 500); 1 Dec 2011 16:46:30 -0000 Mailing-List: contact commits-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list commits@tuscany.apache.org Received: (qmail 60366 invoked by uid 99); 1 Dec 2011 16:46:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 16:46:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 16:46:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8A8B12388A3F for ; Thu, 1 Dec 2011 16:46:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1209146 - in /tuscany/sca-java-2.x/trunk: modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/bind... Date: Thu, 01 Dec 2011 16:46:01 -0000 To: commits@tuscany.apache.org From: slaws@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111201164602.8A8B12388A3F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: slaws Date: Thu Dec 1 16:45:57 2011 New Revision: 1209146 URL: http://svn.apache.org/viewvc?rev=1209146&view=rev Log: Add a mechanism for specifying default intents on policy subjects. This is a rewrite of the previous attempt after Greg pointed out a build order issue on the mail list. Added: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultIntent.java tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultingPolicySubject.java tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultIntentImpl.java Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WebServiceBindingBuilder.java tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java tuscany/sca-java-2.x/trunk/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties Added: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultIntent.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultIntent.java?rev=1209146&view=auto ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultIntent.java (added) +++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultIntent.java Thu Dec 1 16:45:57 2011 @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.policy; + +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Represents a default intent and the intents that must not be present in order + * for this default intent to come into force. + */ +public interface DefaultIntent { + + /** + * Returns the default intent object + * + * @return the intent + */ + Intent getIntent(); + + /** + * Sets the intent object + * + * @param the intent + */ + void setIntent(Intent intent); + + /** + * Returns the list of intent names that must not be present + * in order for the default intent to come into play. + * + * @return the list of mutually exclusive intent names + */ + List getMutuallyExclusiveIntents(); + +} Added: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultingPolicySubject.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultingPolicySubject.java?rev=1209146&view=auto ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultingPolicySubject.java (added) +++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/DefaultingPolicySubject.java Thu Dec 1 16:45:57 2011 @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.policy; + +import java.util.List; + +/** + * A policy subject is an entity in the assembly with which a policy can be + * associated. + * + * This default extension provides a mechanism of associating default intents + * with a policy subject so that the framework will take default intents + * into account if no intents are specified by the user. + * + * Default intents are mainly applicable when an artifact defines mayProvides + * intents but the user specified no intents + */ +public interface DefaultingPolicySubject extends PolicySubject { + + /** + * Default intents are mainly applicable when an + * artifact defines mayProvides intents but the + * user specified no intents. In some cases the + * artifact will implement a default intent so + * this collection provides the information for the + * framework to determine what those defaults are + * + * @return A list of default intent records + */ + List getDefaultIntents(); +} Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java (original) +++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java Thu Dec 1 16:45:57 2011 @@ -69,4 +69,10 @@ public interface PolicyFactory { * @return */ ExternalAttachment createExternalAttachment(); + + /** + * Create a new DefaultIntent + * @return + */ + DefaultIntent createDefaultIntent(); } Added: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultIntentImpl.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultIntentImpl.java?rev=1209146&view=auto ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultIntentImpl.java (added) +++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultIntentImpl.java Thu Dec 1 16:45:57 2011 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.policy.impl; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.policy.DefaultIntent; +import org.apache.tuscany.sca.policy.Intent; + +/** + * Represents a default policy intent and the + * intents that must not be present for it to + * be active + */ +public class DefaultIntentImpl implements DefaultIntent { + + private Intent defaultIntent = null; + private List mutuallyExclusiveIntents = new ArrayList(); + + protected DefaultIntentImpl() { + } + + @Override + public Intent getIntent() { + return defaultIntent; + } + + @Override + public void setIntent(Intent defaultIntent) { + this.defaultIntent = defaultIntent; + } + + @Override + public List getMutuallyExclusiveIntents() { + return mutuallyExclusiveIntents; + } + + public String toString() { + return String.valueOf(defaultIntent.getName()); + } +} Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java (original) +++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java Thu Dec 1 16:45:57 2011 @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.policy.impl; import org.apache.tuscany.sca.policy.BindingType; +import org.apache.tuscany.sca.policy.DefaultIntent; import org.apache.tuscany.sca.policy.ExtensionType; import org.apache.tuscany.sca.policy.ImplementationType; import org.apache.tuscany.sca.policy.Intent; @@ -73,4 +74,7 @@ public abstract class PolicyFactoryImpl return new ExternalAttachmentImpl(); } + public DefaultIntent createDefaultIntent() { + return new DefaultIntentImpl(); + } } Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WebServiceBindingBuilder.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WebServiceBindingBuilder.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WebServiceBindingBuilder.java (original) +++ tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WebServiceBindingBuilder.java Thu Dec 1 16:45:57 2011 @@ -19,8 +19,11 @@ package org.apache.tuscany.sca.binding.ws.wsdlgen; +import java.util.List; + import javax.xml.namespace.QName; +import org.apache.tuscany.sca.assembly.Base; import org.apache.tuscany.sca.assembly.Component; import org.apache.tuscany.sca.assembly.Contract; import org.apache.tuscany.sca.assembly.builder.BindingBuilder; @@ -30,6 +33,8 @@ import org.apache.tuscany.sca.core.Exten import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.policy.BindingType; +import org.apache.tuscany.sca.policy.DefaultingPolicySubject; +import org.apache.tuscany.sca.policy.DefaultIntent; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicyFactory; import org.apache.tuscany.sca.policy.PolicySubject; @@ -42,9 +47,13 @@ import org.apache.tuscany.sca.policy.Pol public class WebServiceBindingBuilder implements BindingBuilder { private ExtensionPointRegistry extensionPoints; + private PolicyFactory policyFactory; public WebServiceBindingBuilder(ExtensionPointRegistry extensionPoints) { this.extensionPoints = extensionPoints; + + FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class); + this.policyFactory = modelFactories.getFactory(PolicyFactory.class); } /** @@ -67,7 +76,51 @@ public class WebServiceBindingBuilder im * it implements SOAP.v1_1 by default and hence the default intent * is SOAP.v1_1. Binding.ws doesn't allwaysProvide SOAP.v1_1 though as if the * user specifies the SOAP.v1_2 the binding does SOAP.v1_2 instead of SOAP.v1_1 - */ + * + * This logic is here rather than in the binding model so that the behaviour + * of the implementation is not dictated by the hard coded condifuration of the + * model. This build runs before the policy builders where this information is used + * TODO - can we get this code into the actual impl modules itself. Move this builder? + */ + List defaultIntents = ((DefaultingPolicySubject)binding).getDefaultIntents(); + DefaultIntent defaultIntent = policyFactory.createDefaultIntent(); + + Definitions systemDefinitions = context.getDefinitions(); + if (systemDefinitions != null){ + BindingType bindingType = systemDefinitions.getBindingType(binding.getType()); + for (Intent mayProvideIntent : bindingType.getMayProvidedIntents()){ + if (mayProvideIntent.getName().getLocalPart().equals("SOAP.v1_1")){ + defaultIntent.setIntent(mayProvideIntent); + } + if (mayProvideIntent.getName().getLocalPart().equals("SOAP.v1_2")){ + defaultIntent.getMutuallyExclusiveIntents().add(mayProvideIntent); + } + } + + defaultIntents.add(defaultIntent); + } + + // if the binding may provide SOAP.v1_1 then use this is as the default if no + // other intents are specified +/* + if (intent != null){ + List defaultIntents = ((DefaultingPolicySubject)binding).getDefaultIntents(); + DefaultIntent defaultIntent = policyFactory.createDefaultIntent(); + + // Add the default intent + defaultIntent.setDefaultIntent(intent); + + // Add the names of all of the intents that must not be present in + // order for the default intent to come into force + defaultIntent.getMutuallyExclusiveIntents().add(new QName(Base.SCA11_NS, "SOAP.v1_1")); + defaultIntent.getMutuallyExclusiveIntents().add(new QName(Base.SCA11_NS, "SOAP.v1_2")); + defaultIntent.getMutuallyExclusiveIntents().add(new QName(Base.SCA11_NS, "SOAP")); + + defaultIntents.add(defaultIntent); + } +*/ + +/* boolean addDefaultSOAPIntent = true; for(Intent intent : ((PolicySubject)binding).getRequiredIntents()){ @@ -97,6 +150,7 @@ public class WebServiceBindingBuilder im } } } +*/ } Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java (original) +++ tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java Thu Dec 1 16:45:57 2011 @@ -45,6 +45,8 @@ import org.apache.tuscany.sca.interfaced import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; +import org.apache.tuscany.sca.policy.DefaultIntent; +import org.apache.tuscany.sca.policy.DefaultingPolicySubject; import org.apache.tuscany.sca.policy.ExtensionType; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicySet; @@ -56,12 +58,13 @@ import org.w3c.dom.Element; * * @version $Rev$ $Date$ */ -class WebServiceBindingImpl implements WebServiceBinding, PolicySubject, Extensible { +class WebServiceBindingImpl implements WebServiceBinding, DefaultingPolicySubject, Extensible { private String name; private String uri; private boolean unresolved; private List extensions = new ArrayList(); private List attributeExtensions = new ArrayList(); + private List defaultIntents = new ArrayList(); private List requiredIntents = new ArrayList(); private List policySets = new ArrayList(); private ExtensionType extensionType; @@ -454,4 +457,9 @@ class WebServiceBindingImpl implements W public Map getWsdliLocations() { return wsdliLocations; } + + @Override + public List getDefaultIntents() { + return defaultIntents; + } } Modified: tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java (original) +++ tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java Thu Dec 1 16:45:57 2011 @@ -45,6 +45,8 @@ import org.apache.tuscany.sca.assembly.b import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.policy.DefaultIntent; +import org.apache.tuscany.sca.policy.DefaultingPolicySubject; import org.apache.tuscany.sca.policy.ExtensionType; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.IntentMap; @@ -382,8 +384,8 @@ public class ComponentPolicyBuilderImpl return null; } - // Replace qualifiable intents with their default qualifier. This can't be done until - // after inheritance. + // Replace qualifiable intents with their default qualifier. + // This can't be done until after inheritance. protected void expandDefaultIntents(PolicySubject subject, BuilderContext context) { Set copy = new HashSet(subject.getRequiredIntents()); @@ -392,8 +394,9 @@ public class ComponentPolicyBuilderImpl subject.getRequiredIntents().remove(i); subject.getRequiredIntents().add(i.getDefaultQualifiedIntent()); } - } + } } + protected void resolveAndNormalize(PolicySubject subject, BuilderContext context) { Definitions definitions = context.getDefinitions(); Set intents = new HashSet(); @@ -586,5 +589,57 @@ public class ComponentPolicyBuilderImpl return false; } } + + // Add in default intents. This looks at the default intent map for + // the policy subject and. If none of the mutually exclusive intents are + // already present adds in the default intent. + protected void addDefaultIntents(PolicySubject subject, Object defaultSubjectObject, BuilderContext context){ + if (!(defaultSubjectObject instanceof DefaultingPolicySubject)){ + return; + } + + DefaultingPolicySubject defaultSubject = (DefaultingPolicySubject)defaultSubjectObject; + List defaultIntents = defaultSubject.getDefaultIntents(); + + for(DefaultIntent defaultIntent : defaultIntents){ + // check default intent against the intents already in the subject + boolean addDefaultIntent = true; + + // first check the intents which, if present prevent the default being applied + for (Intent mutualExclusion : defaultIntent.getMutuallyExclusiveIntents()){ + if (subject.getRequiredIntents().contains(mutualExclusion)){ + addDefaultIntent = false; + break; + } + } + + // then check that the default intent itself is not mutually exclusive + for (Intent userDefinedIntent : subject.getRequiredIntents()){ + if (!checkMutualExclusionNoError(defaultIntent.getIntent(), userDefinedIntent, context)){ + addDefaultIntent = false; + break; + } + } + + if (addDefaultIntent == true){ + subject.getRequiredIntents().add(defaultIntent.getIntent()); + } + } + } + + /** + * Same as checkMutualExclusion but doesn't throw and error on failure + */ + protected boolean checkMutualExclusionNoError(Intent i1, Intent i2, BuilderContext context){ + if ((i1 != i2) && + (i1.getExcludedIntents().contains(i2) || + i2.getExcludedIntents().contains(i1) || + checkQualifiedMutualExclusion(i1.getExcludedIntents(), i2) || + checkQualifiedMutualExclusion(i2.getExcludedIntents(), i1))) { + return true; + } + + return false; + } } Modified: tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java (original) +++ tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java Thu Dec 1 16:45:57 2011 @@ -120,6 +120,9 @@ public class CompositePolicyBuilderImpl // of the structural hierarchy (Policy spec 4.10) inherit(ep, null, false, componentService.getInterfaceContract().getInterface()); } + + // add in default binding mayProvides intents + addDefaultIntents(ep, ep.getBinding(), context); // Replace profile intents with their required intents // Replace unqualified intents if there is a qualified intent in the list @@ -175,6 +178,9 @@ public class CompositePolicyBuilderImpl // of the structural hierarchy (Policy spec 4.10) inherit(epr, null, true, componentReference.getInterfaceContract().getInterface()); } + + // add in default binding mayProvides intents + addDefaultIntents(epr, epr.getBinding(), context); // Replace profile intents with their required intents // Replace unqualified intents if there is a qualified intent in the list Modified: tuscany/sca-java-2.x/trunk/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties?rev=1209146&r1=1209145&r2=1209146&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties (original) +++ tuscany/sca-java-2.x/trunk/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties Thu Dec 1 16:45:57 2011 @@ -61,9 +61,9 @@ JCA_10050=org.oasisopen.sca.ServiceRunti JCA_10051=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90059] The array of interfaces or classes specified by the value attribute of the @Service annotation JCA_10052=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90060] The value of each element in the @Service names array MUST be unique amongst all the other element values in the array JCA_11005=org.oasisopen.sca.ServiceRuntimeException: [Component: TEST_JCA_11005Component1, Service: Service1] - [JCA100006] JAX-WS client-side asynchronous polling and callback methods are not allowed in service interfaces -JCA_11010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11010Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap are mutually exclusive -JCA_11011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11011Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap are mutually exclusive -JCA_11012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap are mutually exclusive +JCA_11010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11010Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive +JCA_11011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11011Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive +JCA_11012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive JCA_11013=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11013Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive JCA_11014=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_11014, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_11014] - [JCA100018] Forbidden annotation interface javax.xml.ws.WebServiceClient found in class org.oasisopen.sca.test.Service1WithWebServiceClient JCA_11016=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - Unable to match the endpoint reference (***)EndpointReference: URI = TEST_JCA_11016Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] with the policy of the service to which it refers, matching process was Match policy of (***)EndpointReference: URI = TEST_JCA_11016Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] to (***)Endpoint: URI = TEST_JCA_11016Component2#service-binding(Service3OperationsWebServiceProviderImpl/Service3OperationsWebServiceProviderImpl) Match because the intents are resolved and there are no policy sets |||Match interface of (***)EndpointReference: URI = TEST_JCA_11016Component1#referen ce(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] to (***)Endpoint: URI = TEST_JCA_11016Component2#service-binding(Service3OperationsWebServiceProviderImpl/Service3OperationsWebServiceProviderImpl) Operation operation3 not found on target|||Match failed because the interface contract mapper failed |||