tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdan...@apache.org
Subject svn commit: r983118 - in /tuscany: otest/newlayout/tuscany-java-caa-test-runner/src/test/resources/ sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ sca-java-2.x/trunk/modules/impl...
Date Fri, 06 Aug 2010 20:16:19 GMT
Author: bdaniel
Date: Fri Aug  6 20:16:19 2010
New Revision: 983118

URL: http://svn.apache.org/viewvc?rev=983118&view=rev
Log:
JCA-11013 Add SOAP intent to the implementation if the java class is annotated with ServiceMode

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/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
    tuscany/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.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=983118&r1=983117&r2=983118&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
Fri Aug  6 20:16:19 2010
@@ -47,6 +47,7 @@ JCA_10051=org.apache.tuscany.sca.contrib
 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

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java?rev=983118&r1=983117&r2=983118&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
Fri Aug  6 20:16:19 2010
@@ -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.Remo
  */
 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();

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java?rev=983118&r1=983117&r2=983118&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
Fri Aug  6 20:16:19 2010
@@ -38,6 +38,7 @@ import org.apache.tuscany.sca.implementa
 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();
     }
 



Mime
View raw message