tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r956599 - in /tuscany/sca-java-2.x/trunk/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ binding-w...
Date Mon, 21 Jun 2010 14:31:11 GMT
Author: slaws
Date: Mon Jun 21 14:31:11 2010
New Revision: 956599

URL: http://svn.apache.org/viewvc?rev=956599&view=rev
Log:
BWS_2018 - add a check that uri doesn't appear on a service callback binding.ws element

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
    tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
    tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties

Modified: tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java?rev=956599&r1=956598&r2=956599&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
Mon Jun 21 14:31:11 2010
@@ -467,11 +467,16 @@ public class CompositeProcessor extends 
                             // Read a <callback>
                             callback = assemblyFactory.createCallback();
                             contract.setCallback(callback);
+                            callback.setParentContract(contract);
 
                             //handle extension attributes
                             this.readExtendedAttributes(reader, name, callback, extensionAttributeProcessor,
context);
 
                             policyProcessor.readPolicies(callback, reader);
+                            
+                            // set the parent model so that binding processing can 
+                            // detect it they're being read as part of a callback 
+                            context.setParentModel(callback);                           

 
                         } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) {
 

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java?rev=956599&r1=956598&r2=956599&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java
Mon Jun 21 14:31:11 2010
@@ -35,5 +35,19 @@ public interface Callback extends Base, 
      * @return the bindings supported for callbacks
      */
     List<Binding> getBindings();
+    
+    /**
+     * Returns the contract that holds this callback
+     * 
+     * @return the contract that holds this callback
+     */
+    Contract getParentContract();
+    
+    /**
+     * Sets the contract that holds this callback
+     * 
+     * @param contract the contract that holds this callback
+     */    
+    void setParentContract(Contract contract);
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java?rev=956599&r1=956598&r2=956599&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
Mon Jun 21 14:31:11 2010
@@ -24,6 +24,7 @@ import java.util.List;
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Callback;
+import org.apache.tuscany.sca.assembly.Contract;
 import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySet;
@@ -37,6 +38,7 @@ public class CallbackImpl extends Extens
     private List<Binding> bindings = new ArrayList<Binding>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
+    private Contract parentContract;
 
     public List<PolicySet> getPolicySets() {
         return policySets;
@@ -63,5 +65,15 @@ public class CallbackImpl extends Extens
     public void setRequiredIntents(List<Intent> intents) {
         this.requiredIntents = intents;
     }
+    
+    @Override
+    public Contract getParentContract() {
+        return parentContract;
+    }
+    
+    @Override
+    public void setParentContract(Contract contract) {
+        this.parentContract = contract;
+    }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.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/xml/WebServiceBindingProcessor.java?rev=956599&r1=956598&r2=956599&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
Mon Jun 21 14:31:11 2010
@@ -37,6 +37,7 @@ import javax.xml.stream.XMLStreamExcepti
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.assembly.Callback;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
 import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
@@ -149,6 +150,12 @@ public class WebServiceBindingProcessor 
                     error(monitor, "InvalidURISyntax", reader, ex.getMessage());
                 }
             }
+            
+            // BWS20020
+            if ((context.getParentModel() instanceof Callback) &&
+                (((Callback)context.getParentModel()).getParentContract() instanceof org.apache.tuscany.sca.assembly.Service)){
+                error(monitor, "URIFoundForServiceCallback", reader, uri);
+            }
         }
 
         // Read a qname in the form:

Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties?rev=956599&r1=956598&r2=956599&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties
Mon Jun 21 14:31:11 2010
@@ -24,10 +24,11 @@ InvalidInterfaceException = Exception cr
 WsdlBindingDoesNotMatch = The #wsdl.binding({0}) not found in the available WSDL Definitions
 WsdlServiceDoesNotMatch = [BWS20005] The #wsdl.service({0}) not found in the available WSDL
Definitions
 WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Definitions
-WsdliLocationMissingWsdlElement = binding.ws has a @wsdli:wsdlLocation attribute but no @wsdlElement
attribute
+WsdliLocationMissingWsdlElement = [BWS20017] binding.ws has a @wsdli:wsdlLocation attribute
but no @wsdlElement attribute
 URINotAbsolute = [BWS20001] The URI value for binding.ws on an SCA reference must be absolute.
Non-absolute value found {0}
 InvalidURISyntax =  The URI value {0} found on binding.ws has invalid syntax
 WSDLServiceOnService = [BWS20003] The wsdlElement attribute of a binding.ws on an SCA service
must not specify the wsdl.service form of URI. The following URI was found {0}
+URIFoundForServiceCallback = [BWS20020] For the callback element of an SCA service, the binding
must not specify an endpoint address URI or a WS-Addressing wsa:EndpointReference
 
 
 



Mime
View raw message