tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
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 GMT
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<Intent> 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<DefaultIntent> 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<Intent> mutuallyExclusiveIntents = new ArrayList<Intent>();
+
+    protected DefaultIntentImpl() {
+    }
+
+    @Override
+    public Intent getIntent() {
+        return defaultIntent;
+    }
+    
+    @Override
+    public void setIntent(Intent defaultIntent) {
+        this.defaultIntent = defaultIntent;
+    }
+    
+    @Override
+    public List<Intent> 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<WebServiceBinding>
{
 
     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<DefaultIntent> 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<DefaultIntent> 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<Object> extensions = new ArrayList<Object>();
     private List<Extension> attributeExtensions = new ArrayList<Extension>();
+    private List<DefaultIntent> defaultIntents = new ArrayList<DefaultIntent>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
     private ExtensionType extensionType;
@@ -454,4 +457,9 @@ class WebServiceBindingImpl implements W
     public Map<String, String> getWsdliLocations() {
         return wsdliLocations;
     }
+    
+    @Override
+    public List<DefaultIntent> 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<Intent> copy = new HashSet<Intent>(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<Intent> intents = new HashSet<Intent>();
@@ -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<DefaultIntent> 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 |||



Mime
View raw message