From f2b42e0aa1bf6478bda803aea9f0040e0e3fa533 Mon Sep 17 00:00:00 2001 From: bdaniel Date: Fri, 6 Aug 2010 03:44:35 +0000 Subject: Treat java interfaces annotated with @SOAPBinding as having the SOAP intent (JCA_11012) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@982861 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/resources/tuscany-oasis-sca-tests-errors.properties | 1 + .../sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties index 7000177714..2f99d139f7 100644 --- a/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties +++ b/otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties @@ -46,6 +46,7 @@ JCA_10050=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oa 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_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 # Intent and PolicySet related tests JCA_8001=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_8001Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent1 are mutually exclusive JCA_8002=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8002: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Method that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadIntent.operation1(java.lang.String) diff --git a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java index 1610a2e8ec..8f760e8593 100644 --- a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java +++ b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java @@ -25,8 +25,10 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.jws.soap.SOAPBinding; import javax.xml.namespace.QName; +import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; @@ -104,6 +106,13 @@ public class PolicyJavaInterfaceVisitor implements JavaInterfaceVisitor { } } } + + if ( clazz.getAnnotation(SOAPBinding.class) != null ) { + // add soap intent + Intent intent = policyFactory.createIntent(); + intent.setName(Constants.SOAP_INTENT); + requiredIntents.add(intent); + } } private void readIntents(Requires intentAnnotation, List requiredIntents) { -- cgit v1.2.3