cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1211267 - in /cxf/trunk/rt/frontend/jaxws/src/main: java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java
Date Wed, 07 Dec 2011 01:54:20 GMT
Author: dkulp
Date: Wed Dec  7 01:54:19 2011
New Revision: 1211267

URL: http://svn.apache.org/viewvc?rev=1211267&view=rev
Log:
[CXF-3959] Fix same issue with JAXWS 2.2

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java

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=1211267&r1=1211266&r2=1211267&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
Wed Dec  7 01:54:19 2011
@@ -152,7 +152,7 @@ public class EndpointDefinitionParser ex
         if (!StringUtils.isEmpty(val)) {
             if (val.startsWith("#")) {
                 bean.addConstructorArgReference(val.substring(1));
-                bean.addPropertyValue("checkBlockConstuct", Boolean.TRUE);
+                bean.addPropertyValue("checkBlockConstruct", Boolean.TRUE);
             } else {
                 try {
                     Object obj = ClassLoaderUtils.loadClass(val, getClass()).newInstance();
@@ -191,7 +191,7 @@ public class EndpointDefinitionParser ex
             super(bus, implementor);
         }
         
-        public void setCheckBlockConstuct(Boolean b) {
+        public void setCheckBlockConstruct(Boolean b) {
             checkBlockConstruct = b;
         }
         

Modified: cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java?rev=1211267&r1=1211266&r2=1211267&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/jaxws22/org/apache/cxf/jaxws22/spring/JAXWS22SpringEndpointImpl.java
Wed Dec  7 01:54:19 2011
@@ -29,6 +29,8 @@ import org.springframework.context.Appli
 public class JAXWS22SpringEndpointImpl extends org.apache.cxf.jaxws22.EndpointImpl
     implements ApplicationContextAware {
 
+    boolean checkBlockConstruct;
+
     public JAXWS22SpringEndpointImpl(Object o) {
         super(o instanceof Bus ? (Bus)o : null,
               o instanceof Bus ? null : o);
@@ -38,7 +40,26 @@ public class JAXWS22SpringEndpointImpl e
         super(bus, implementor);
     }
     
+    public void setCheckBlockConstruct(Boolean b) {
+        checkBlockConstruct = b;
+    }
+    
     public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+        if (checkBlockConstruct) {
+            try {
+                Class<?> cls = Class
+                    .forName("org.springframework.context.annotation.CommonAnnotationBeanPostProcessor");
+                if (ctx.getBeanNamesForType(cls, true, false).length != 0) {
+                    //Spring will handle the postconstruct, but won't inject the 
+                    // WebServiceContext so we do need to do that.
+                    super.getServerFactory().setBlockPostConstruct(true);
+                } else {
+                    super.getServerFactory().setBlockInjection(true);
+                }
+            } catch (ClassNotFoundException e) {
+                //ignore
+            }
+        }
         if (getBus() == null) {
             setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
         }



Mime
View raw message