You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/01/18 21:44:02 UTC

svn commit: r900546 - in /tuscany/sca-java-2.x/trunk/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/ policy-wspolicy/src/main/resources/META-INF/services/

Author: slaws
Date: Mon Jan 18 20:44:02 2010
New Revision: 900546

URL: http://svn.apache.org/viewvc?rev=900546&view=rev
Log:
Check that all policies in a given policy set are expressed in a single language. 

Added:
    tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder
Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
    tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties

Modified: tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java?rev=900546&r1=900545&r2=900546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java Mon Jan 18 20:44:02 2010
@@ -217,7 +217,20 @@
                             PolicyExpression exp = policyFactory.createPolicyExpression();
                             exp.setName(name);
                             exp.setPolicy(extension);
-                            policySet.getPolicies().add(exp);
+                            // check that all the policies in the policy set are 
+                            // expressed in the same language. Compare against the 
+                            // first expression we added
+                            if ((policySet.getPolicies().size() > 0) &&
+                                (!policySet.getPolicies().get(0).getName().equals(name))){
+                                error(monitor, 
+                                      "PolicyLanguageMissmatch", 
+                                      reader, 
+                                      policySet.getName(), 
+                                      policySet.getPolicies().get(0).getName(), 
+                                      name);
+                            } else {   
+                                policySet.getPolicies().add(exp);
+                            }
                         }
                     }
                     break;

Modified: tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties?rev=900546&r1=900545&r2=900546&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties (original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties Mon Jan 18 20:44:02 2010
@@ -47,3 +47,4 @@
 ProfileIntentNameWithPeriod = [POL30006] The profile intent name {0} must not have the character "." in it
 IntentMapIsNotUnique = [POL30010] The policy set {0} has more than one intent map with the name {1}
 IntentMapMissingQualifiers = [POL30020] The policy set {0} intent map {1} has missing qualifiers: {2} The intent map qualifiers must match the provided intent qualifiers.
+PolicyLanguageMissmatch = Policy set {0} contains policy expressions from more than on language, languages {1} and {2} found 

Added: tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder?rev=900546&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder (added)
+++ tuscany/sca-java-2.x/trunk/modules/policy-wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder Mon Jan 18 20:44:02 2010
@@ -0,0 +1,17 @@
+# 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. 
+org.apache.tuscany.sca.policy.wspolicy.WSPolicyBuilder;qname=http://schemas.xmlsoap.org/ws/2004/09/policy#Policy