You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by bd...@apache.org on 2010/08/09 22:07:28 UTC

svn commit: r983802 - in /tuscany: otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/ sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/

Author: bdaniel
Date: Mon Aug  9 20:07:27 2010
New Revision: 983802

URL: http://svn.apache.org/viewvc?rev=983802&view=rev
Log:
JCA 11010 Add SOAP intent to the interface if any parameter on any method in the interface is annotated with @WebParam with header=true

Modified:
    tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
    tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java

Modified: tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties
URL: http://svn.apache.org/viewvc/tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties?rev=983802&r1=983801&r2=983802&view=diff
==============================================================================
--- tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties (original)
+++ tuscany/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties Mon Aug  9 20:07:27 2010
@@ -46,6 +46,7 @@ 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/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

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java?rev=983802&r1=983801&r2=983802&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java Mon Aug  9 20:07:27 2010
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import javax.jws.WebParam;
 import javax.jws.WebResult;
 import javax.jws.soap.SOAPBinding;
 import javax.xml.namespace.QName;
@@ -158,7 +159,8 @@ public class PolicyJavaInterfaceVisitor 
         }
     }
 
-	public void readWebResult(Method m, Class<?> clazz, List<Intent> requiredIntents) {
+	public void readWebServicesAnnotations(Method m, Class<?> clazz, List<Intent> requiredIntents) {
+		
 		WebResult webResultAnnotation = m.getAnnotation(WebResult.class);
 		if (webResultAnnotation != null) {
 			if (webResultAnnotation.header()) {
@@ -166,8 +168,26 @@ public class PolicyJavaInterfaceVisitor 
 				Intent intent = policyFactory.createIntent();
 				intent.setName(Constants.SOAP_INTENT);
 				requiredIntents.add(intent);
+				return;
 			}
 		}
+		
+		Annotation[][] parameterAnnotations = m.getParameterAnnotations();
+		for ( int i=0; i < parameterAnnotations.length; i++ ) {
+			for ( int j=0; j < parameterAnnotations[i].length; j++) {
+				if ( parameterAnnotations[i][j] instanceof WebParam ) {
+					WebParam webParam = (WebParam)parameterAnnotations[i][j];
+					if ( webParam.header() ) {
+						// Add SOAP intent
+						Intent intent = policyFactory.createIntent();
+						intent.setName(Constants.SOAP_INTENT);
+						requiredIntents.add(intent);
+						return;
+					}
+				}
+			}
+		}
+
 	}
     public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
 
@@ -183,7 +203,7 @@ public class PolicyJavaInterfaceVisitor 
                 readIntents(method.getAnnotation(Requires.class), op.getRequiredIntents());
                 readSpecificIntents(method.getAnnotations(), op.getRequiredIntents());
                 readPolicySets(method.getAnnotation(PolicySets.class), op.getPolicySets());
-                readWebResult(method, javaInterface.getJavaClass(), javaInterface.getRequiredIntents());
+                readWebServicesAnnotations(method, javaInterface.getJavaClass(), javaInterface.getRequiredIntents());
             }
         }
     }