summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java42
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java3
3 files changed, 27 insertions, 19 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 74c46210e1..778773b38e 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_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
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
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
index db824d658e..f8b087662b 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
@@ -18,35 +18,25 @@
*/
package org.apache.tuscany.sca.implementation.java.introspect.impl;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
import javax.jws.WebService;
-import javax.xml.namespace.QName;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Service;
+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.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.annotation.Callback;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyFactory;
import org.oasisopen.sca.annotation.Remotable;
/**
@@ -55,17 +45,33 @@ import org.oasisopen.sca.annotation.Remotable;
*/
public class JAXWSProcessor extends BaseJavaClassVisitor {
- public JAXWSProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory) {
+ private PolicyFactory policyFactory;
+
+ public JAXWSProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, PolicyFactory policyFactory) {
super(assemblyFactory);
- this.javaInterfaceFactory = javaFactory;
+ this.javaInterfaceFactory = javaFactory;
+ this.policyFactory = policyFactory;
}
public JAXWSProcessor(ExtensionPointRegistry registry) {
super(registry);
+ this.policyFactory = registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(PolicyFactory.class);
}
@Override
public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
+ if ( clazz.getAnnotation(ServiceMode.class) != null ) {
+ // Add soap intent - JCA 11013
+ Intent soapIntent = policyFactory.createIntent();
+ soapIntent.setName(Constants.SOAP_INTENT);
+ type.getRequiredIntents().add(soapIntent);
+ }
+
+ if ( clazz.getAnnotation(WebServiceProvider.class) != null ) {
+ // TODO Apply @Remotable to interfaces here
+ // JCA 11015
+ }
+
WebService webService = clazz.getAnnotation(WebService.class);
String tns = JavaXMLMapper.getNamespace(clazz);
String localName = clazz.getSimpleName();
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java b/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
index 3fd113f761..7fb07713c6 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
@@ -38,6 +38,7 @@ import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
import org.apache.tuscany.sca.interfacedef.InvalidCallbackException;
import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
import org.junit.Before;
import org.junit.Test;
import org.oasisopen.sca.ServiceReference;
@@ -54,7 +55,7 @@ public class JAXWSProcessorTestCase {
@Before
public void setUp() throws Exception {
ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- processor = new JAXWSProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory(registry));
+ processor = new JAXWSProcessor(new DefaultAssemblyFactory(), new DefaultJavaInterfaceFactory(registry), new DefaultPolicyFactory());
javaImplementationFactory = new DefaultJavaImplementationFactory();
}