cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r561354 - in /incubator/cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/ main/resources/schemas/ test/java/org/apache/cxf/jaxws/spring/
Date Tue, 31 Jul 2007 15:03:54 GMT
Author: dandiep
Date: Tue Jul 31 08:03:43 2007
New Revision: 561354

URL: http://svn.apache.org/viewvc?view=rev&rev=561354
Log:
Add the ability to specify the implementorClass in case the actual implementor is a proxy.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=561354&r1=561353&r2=561354
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
Tue Jul 31 08:03:43 2007
@@ -74,6 +74,7 @@
     private String address;
     private QName endpointName;
     private QName serviceName;
+    private Class implementorClass;
     
     private List<AbstractFeature> features;
     private List<Interceptor> in = new ModCountCopyOnWriteArrayList<Interceptor>();
@@ -148,7 +149,7 @@
      * @return the class of the implementor object
      */
     public Class getImplementorClass() {
-        return implementor.getClass();
+        return implementorClass != null ? implementorClass : implementor.getClass();
     }
 
     public List<Source> getMetadata() {
@@ -274,6 +275,10 @@
                 serverFactory.getServiceFactory().setServiceName(serviceName);
             }
             
+            if (implementorClass != null) {
+                serverFactory.setServiceClass(implementorClass);
+            }
+            
             configureObject(serverFactory);
             
             server = serverFactory.create();
@@ -420,6 +425,10 @@
 
     public void setInvoker(Invoker invoker) {
         this.invoker = invoker;
+    }
+
+    public void setImplementorClass(Class implementorClass) {
+        this.implementorClass = implementorClass;
     }
     
     /*

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd?view=diff&rev=561354&r1=561353&r2=561354
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd Tue Jul 31
08:03:43 2007
@@ -53,6 +53,7 @@
           <xsd:attribute name="bindingUri" type="xsd:string" />
           <xsd:attribute name="bus" type="xsd:string" />
           <xsd:attribute name="implementor" type="xsd:string"/>
+          <xsd:attribute name="implementorClass" type="xsd:string"/>
           <xsd:attribute name="publish" type="xsd:boolean" default="true"/>
           <xsd:attribute name="endpointName" type="xsd:QName" />
           <xsd:attribute name="serviceName" type="xsd:QName" />

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?view=diff&rev=561354&r1=561353&r2=561354
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Tue Jul 31 08:03:43 2007
@@ -85,6 +85,12 @@
         ep = (EndpointImpl) bean;
         assertTrue(ep.getInvoker() instanceof NullInvoker);
         assertTrue(ep.getService().getInvoker() instanceof NullInvoker);
+
+        bean = ctx.getBean("implementorClass");
+        assertNotNull(bean);
+        ep = (EndpointImpl) bean;
+        assertEquals(Hello.class, ep.getImplementorClass());
+        assertTrue(ep.getImplementor().getClass() == Object.class);
         
         bean = ctx.getBean("epWithProps");
         assertNotNull(bean);
@@ -109,6 +115,21 @@
         bean = ctx.getBean("wsdlLocation");
         assertNotNull(bean);
         
+        // test for existence of Endpoint without an id element
+        boolean found = false;
+        String[] names = ctx.getBeanNamesForType(EndpointImpl.class);
+        for (String n : names) {
+            if (n.startsWith(EndpointImpl.class.getName())) { 
+                found = true;
+            }
+        }
+        assertTrue("Could not find server factory with autogenerated id", found);
+        
+        testInterceptors(ctx);
+    }
+
+    private void testInterceptors(ClassPathXmlApplicationContext ctx) {
+        EndpointImpl ep;
         ep = (EndpointImpl) ctx.getBean("epWithInterceptors");
         assertNotNull(ep);
         List<Interceptor> inInterceptors = ep.getInInterceptors();
@@ -134,17 +155,6 @@
             }
         }
         assertTrue(saaj);
-        assertTrue(logging);
-        
-        // test for existence of Endpoint without an id element
-        boolean found = false;
-        String[] names = ctx.getBeanNamesForType(EndpointImpl.class);
-        for (String n : names) {
-            if (n.startsWith(EndpointImpl.class.getName())) { 
-                found = true;
-            }
-        }
-        assertTrue("Could not find server factory with autogenerated id", found);
     }
     
     @Test

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?view=diff&rev=561354&r1=561353&r2=561354
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
Tue Jul 31 08:03:43 2007
@@ -100,4 +100,10 @@
 
   <jaxws:endpoint implementor="org.apache.cxf.jaxws.service.Hello"
     address="http://localhost:8080/test"/>
+    
+    
+  <jaxws:endpoint id="implementorClass"
+    implementor="java.lang.Object"
+    implementorClass="org.apache.cxf.jaxws.service.Hello"
+    address="http://localhost:8080/test"/>
 </beans>



Mime
View raw message