summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-06 04:03:57 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-08-06 04:03:57 +0000
commit4665f0e91d0c8934bb463da10cf57d919c7d424b (patch)
tree031ba5d8aaffb96ed8cae15d12d4189a10c2c061
parentf2b42e0aa1bf6478bda803aea9f0040e0e3fa533 (diff)
Report an error if a class annotated with @WebServiceClient is used as an SCA interface (JCA 11014)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@982867 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/tuscany-oasis-sca-tests-errors.properties1
-rw-r--r--sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java6
-rw-r--r--sca-java-2.x/trunk/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties1
3 files changed, 8 insertions, 0 deletions
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 2f99d139f7..74c46210e1 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
@@ -47,6 +47,7 @@ JCA_10051=org.apache.tuscany.sca.contribution.processor.ContributionResolveExcep
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
+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
# 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/xml/JavaInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
index 805e691f16..8502d4f4e8 100644
--- a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
+++ b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
@@ -31,6 +31,7 @@ import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceClient;
import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
@@ -279,6 +280,11 @@ public class JavaInterfaceProcessor implements StAXArtifactProcessor<JavaInterfa
error(monitor, "ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName());
}
}
+
+ if ( a.annotationType().equals(WebServiceClient.class) ) {
+ error(monitor, "ForbiddenAnnotationJCA100018", javaInterfaceContract, a.annotationType(), ifc.getName());
+ }
+
}
for (Method m : ifc.getMethods()) {
for (Annotation a : m.getAnnotations()) {
diff --git a/sca-java-2.x/trunk/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties b/sca-java-2.x/trunk/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
index 73a25551b7..329f55e0a7 100644
--- a/sca-java-2.x/trunk/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
+++ b/sca-java-2.x/trunk/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
@@ -24,4 +24,5 @@ InvalidInterfaceException = InvalidInterfaceException due to: {0}
ForbiddenAnnotationJCA30006 = [JCA30006] Forbidden annotation {0} found on service interface in class {1}
ForbiddenAnnotationJCA30007 = [JCA30007] Forbidden annotation {0} found on callback interface in class {1}
ForbiddenAnnotationJCA30008 = [JCA30008] Forbidden annotation {0} found in class {1}
+ForbiddenAnnotationJCA100018 = [JCA100018] Forbidden annotation {0} found in class {1}