Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 81686 invoked from network); 30 Jun 2009 13:13:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Jun 2009 13:13:54 -0000 Received: (qmail 75954 invoked by uid 500); 30 Jun 2009 13:14:05 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 75897 invoked by uid 500); 30 Jun 2009 13:14:05 -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 75887 invoked by uid 99); 30 Jun 2009 13:14:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jun 2009 13:14:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Tue, 30 Jun 2009 13:13:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D033A2388903; Tue, 30 Jun 2009 13:13:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r789704 - in /cxf/trunk/rt/core/src/main: java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java resources/META-INF/cxf/cxf.xml Date: Tue, 30 Jun 2009 13:13:33 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090630131333.D033A2388903@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Jun 30 13:13:33 2009 New Revision: 789704 URL: http://svn.apache.org/viewvc?rev=789704&view=rev Log: [CXF-2210] Change JSR250BeanPostProcess to check the context itself to see if Spring is handling the JSR250 annotations. Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java?rev=789704&r1=789703&r2=789704&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java Tue Jun 30 13:13:33 2009 @@ -24,9 +24,7 @@ import java.util.List; import java.util.Map; -import javax.annotation.Resource; -import org.apache.cxf.Bus; import org.apache.cxf.common.injection.ResourceInjector; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.resource.ResourceManager; @@ -45,18 +43,20 @@ private ApplicationContext context; - private Bus bus; + private boolean isProcessing = true; Jsr250BeanPostProcessor() { } - @Resource - public void setBus(Bus b) { - bus = b; - } - public void setApplicationContext(ApplicationContext arg0) throws BeansException { - context = arg0; + context = arg0; + try { + Class cls = Class + .forName("org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"); + isProcessing = context.getBeanNamesForType(cls, true, false).length == 0; + } catch (ClassNotFoundException e) { + isProcessing = true; + } } public int getOrder() { @@ -64,7 +64,7 @@ } public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException { - if (bus != null) { + if (!isProcessing) { return bean; } if (bean != null) { @@ -82,7 +82,7 @@ } public Object postProcessBeforeInitialization(Object bean, String beanId) throws BeansException { - if (bus != null) { + if (!isProcessing) { return bean; } if (bean != null) { @@ -92,7 +92,7 @@ } public void postProcessBeforeDestruction(Object bean, String beanId) { - if (bus != null) { + if (!isProcessing) { return; } if (bean != null) { Modified: cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml?rev=789704&r1=789703&r2=789704&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml (original) +++ cxf/trunk/rt/core/src/main/resources/META-INF/cxf/cxf.xml Tue Jun 30 13:13:33 2009 @@ -19,10 +19,15 @@ --> +http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd +http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> +