cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1355413 - /cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Date Fri, 29 Jun 2012 14:35:04 GMT
Author: dkulp
Date: Fri Jun 29 14:35:03 2012
New Revision: 1355413

URL: http://svn.apache.org/viewvc?rev=1355413&view=rev
Log:
Merged revisions 1355201 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1355201 | dkulp | 2012-06-28 20:46:20 -0400 (Thu, 28 Jun 2012) | 3 lines

  Examine the actual BeanPostProcessors that are found on the context to
  determine which injections we need.

........

Modified:
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=1355413&r1=1355412&r2=1355413&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Fri Jun 29 14:35:03 2012
@@ -40,8 +40,11 @@ import org.apache.cxf.jaxws.EndpointImpl
 import org.apache.cxf.jaxws.spi.ProviderImpl;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
@@ -172,20 +175,27 @@ public class EndpointDefinitionParser ex
     }
     
     public static final void setBlocking(ApplicationContext ctx, EndpointImpl impl) {
+        Class<?> cls = null;
         try {
-            Class<?> cls = 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.
-                impl.getServerFactory().setBlockPostConstruct(true);
-            } else if (ctx.containsBean(Jsr250BeanPostProcessor.class.getName())) {
-                impl.getServerFactory().setBlockInjection(true);
-            }
         } catch (ClassNotFoundException e) {
             //ignore
         }
-
+        AutowireCapableBeanFactory fact = ctx.getAutowireCapableBeanFactory();
+        if (fact instanceof DefaultListableBeanFactory) {
+            DefaultListableBeanFactory dlbf = (DefaultListableBeanFactory)fact;
+            for (BeanPostProcessor bpp : dlbf.getBeanPostProcessors()) {
+                if (cls != null && cls.isInstance(bpp)) {
+                    impl.getServerFactory().setBlockPostConstruct(true);
+                    impl.getServerFactory().setBlockInjection(true);
+                    return;
+                }
+                if (bpp instanceof Jsr250BeanPostProcessor) {
+                    impl.getServerFactory().setBlockInjection(true);
+                }
+            }
+        }
     }
     
     @NoJSR250Annotations



Mime
View raw message