Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D5FEFDE4D for ; Fri, 29 Jun 2012 14:55:09 +0000 (UTC) Received: (qmail 40360 invoked by uid 500); 29 Jun 2012 14:55:09 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 40307 invoked by uid 500); 29 Jun 2012 14:55:09 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 40299 invoked by uid 99); 29 Jun 2012 14:55:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 14:55:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jun 2012 14:55:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 24F3D238896F; Fri, 29 Jun 2012 14:54:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1355424 - /cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Date: Fri, 29 Jun 2012 14:54:45 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120629145446.24F3D238896F@eris.apache.org> Author: dkulp Date: Fri Jun 29 14:54:44 2012 New Revision: 1355424 URL: http://svn.apache.org/viewvc?rev=1355424&view=rev Log: Merged revisions 1355413 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes ........ r1355413 | dkulp | 2012-06-29 10:35:03 -0400 (Fri, 29 Jun 2012) | 11 lines 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.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=1355424&r1=1355423&r2=1355424&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java (original) +++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java Fri Jun 29 14:54:44 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