cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r986402 - in /cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java test/java/org/apache/cxf/jaxws/spring/endpoints.xml
Date Tue, 17 Aug 2010 17:20:50 GMT
Author: dkulp
Date: Tue Aug 17 17:20:49 2010
New Revision: 986402

URL: http://svn.apache.org/viewvc?rev=986402&view=rev
Log:
[CXF-2945] Support the publish=false use case on jaxws:endpoint
Patch from Eric Pederson applied

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=986402&r1=986401&r2=986402&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Tue Aug 17 17:20:49 2010
@@ -80,6 +80,7 @@ public class EndpointDefinitionParser ex
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
         boolean isAbstract = false;
+        boolean publish = true;
         NamedNodeMap atts = element.getAttributes();
         String bus = element.getAttribute("bus");
         if (StringUtils.isEmpty(bus)) {
@@ -110,6 +111,8 @@ public class EndpointDefinitionParser ex
             } else if ("abstract".equals(name)) {
                 bean.setAbstract(true);
                 isAbstract = true;
+            } else if ("publish".equals(name)) {
+                publish = "true".equals(val);
             }
         }
         
@@ -136,7 +139,9 @@ public class EndpointDefinitionParser ex
             elem = DOMUtils.getNextElement(elem);
         }
         if (!isAbstract) {
-            bean.setInitMethodName("publish");
+            if (publish) {
+                bean.setInitMethodName("publish");
+            }
             bean.setDestroyMethodName("stop");
         }
         // We don't want to delay the registration of our Server

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?rev=986402&r1=986401&r2=986402&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Tue Aug 17 17:20:49 2010
@@ -163,6 +163,9 @@ public class SpringBeansTest extends Ass
         }
         assertTrue("Could not find server factory with autogenerated id", found);
 
+        ep = getEndpointImplBean("unpublishedEndpoint", ctx);
+        assertFalse("Unpublished endpoint is published", ep.isPublished());
+
         testInterceptors(ctx);
     }
 

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?rev=986402&r1=986401&r2=986402&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml Tue
Aug 17 17:20:49 2010
@@ -141,4 +141,9 @@ http://cxf.apache.org/jaxws http://cxf.a
     implementor="#greeter"
     address="http://localhost:8080/publishedEndpointUrl"
     publishedEndpointUrl="http://cxf.apache.org/Greeter"/>
+
+  <jaxws:endpoint id="unpublishedEndpoint"
+    implementor="#greeter"
+    address="http://localhost:8080/unpublished"
+    publish="false"/>
 </beans>



Mime
View raw message