Author: dkulp Date: Tue Jun 30 14:37:39 2009 New Revision: 789763 URL: http://svn.apache.org/viewvc?rev=789763&view=rev Log: Merged revisions 789712 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................ r789712 | dkulp | 2009-06-30 09:25:07 -0400 (Tue, 30 Jun 2009) | 10 lines Merged revisions 789704 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r789704 | dkulp | 2009-06-30 09:13:33 -0400 (Tue, 30 Jun 2009) | 2 lines [CXF-2210] Change JSR250BeanPostProcess to check the context itself to see if Spring is handling the JSR250 annotations. ........ ................ Modified: cxf/branches/2.1.x-fixes/ (props changed) cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java cxf/branches/2.1.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Jun 30 14:37:39 2009 @@ -1,2 +1,2 @@ -/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710 -/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529 +/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197,785293,785296,785298-785299,785301,785656,786158,786587,786589,786591-786592,786640,787272,787276,787282-787283,787285,787295,787307,787324,7873 67,788824-788825,788827-788828,788830,789423,789429,789707,789709-789710,789712 +/cxf/trunk:782181,782728-782730,783097,783396,784059,784181,784895,785279-785282,785468,786142,786271,786395,786582-786583,786638,786647,787269,787277-787279,787290,787305,787323,787366,788060,788187,788703,788774,788820,789371,789420,789527-789529,789704 Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java?rev=789763&r1=789762&r2=789763&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java (original) +++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java Tue Jun 30 14:37:39 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/branches/2.1.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml?rev=789763&r1=789762&r2=789763&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml (original) +++ cxf/branches/2.1.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml Tue Jun 30 14:37:39 2009 @@ -19,10 +19,15 @@ --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:foo="http://cxf.apache.org/configuration/foo" + xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" -http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> +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"> + <!-- For Testing using the Swing commons processor, uncomment one of: + <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/> + <context:annotation-config/> + --> <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"/> <bean id="org.apache.cxf.bus.spring.BusApplicationListener" class="org.apache.cxf.bus.spring.BusApplicationListener"/> <bean id="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor" class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"/>
