cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1372929 - in /cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring: BusApplicationContextResourceResolver.java BusWiringBeanFactoryPostProcessor.java OldSpringSupport.java SpringBeanLocator.java SpringBus.java
Date Tue, 14 Aug 2012 15:39:44 GMT
Author: dkulp
Date: Tue Aug 14 15:39:44 2012
New Revision: 1372929

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

........
  r1372927 | dkulp | 2012-08-14 11:34:25 -0400 (Tue, 14 Aug 2012) | 2 lines

  [CXF-4470] Restore spring 2.5.6 compat for cxf:bus

........

Modified:
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java?rev=1372929&r1=1372928&r2=1372929&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
Tue Aug 14 15:39:44 2012
@@ -71,7 +71,7 @@ public class BusApplicationContextResour
             if (resourceName == null) {
                 resource = resourceType.cast(context.getBean(resourceType));
             } else {
-                resource = resourceType.cast(context.getBean(resourceName, resourceType));
+                resource = resourceType.cast(resourceType.cast(context.getBean(resourceName,
resourceType)));
             }
             return resource;
         } catch (NoSuchBeanDefinitionException def) {

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java?rev=1372929&r1=1372928&r2=1372929&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
Tue Aug 14 15:39:44 2012
@@ -192,7 +192,7 @@ public class BusWiringBeanFactoryPostPro
                 new BusWiringBeanFactoryPostProcessor(b).postProcessBeanFactory(cctx.getBeanFactory());
             }
         }
-        return ctx.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
+        return Bus.class.cast(ctx.getBean(Bus.DEFAULT_BUS_ID, Bus.class));
     }
     public static Bus addBus(ApplicationContext ctx, String name) {
         return getBusForName(name, ctx, true);

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java?rev=1372929&r1=1372928&r2=1372929&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
Tue Aug 14 15:39:44 2012
@@ -30,7 +30,8 @@ import org.springframework.beans.factory
 /**
  * 
  */
-public final class OldSpringSupport implements FactoryBean<Object>, BeanNameAware {
+@SuppressWarnings("rawtypes")
+public final class OldSpringSupport implements FactoryBean, BeanNameAware {
     public static final Logger LOG = LogUtils.getL7dLogger(OldSpringSupport.class);
     Bus bus;
     Class<?> cls;

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java?rev=1372929&r1=1372928&r2=1372929&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
Tue Aug 14 15:39:44 2012
@@ -112,7 +112,7 @@ public class SpringBeanLocator implement
     public <T> T getBeanOfType(String name, Class<T> type) {
         T t = null;
         try {
-            t = context.getBean(name, type);
+            t = type.cast(context.getBean(name, type));
         } catch (NoSuchBeanDefinitionException nsbde) {
             //ignore
         }
@@ -140,7 +140,7 @@ public class SpringBeanLocator implement
         s.removeAll(passThroughs);
         List<T> lst = new LinkedList<T>();
         for (String n : s) {
-            lst.add(context.getBean(n, type));
+            lst.add(type.cast(context.getBean(n, type)));
         }
         lst.addAll(orig.getBeansOfType(type));
         if (lst.isEmpty()) {

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1372929&r1=1372928&r2=1372929&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
Tue Aug 14 15:39:44 2012
@@ -44,7 +44,7 @@ import org.springframework.context.suppo
  * 
  */
 public class SpringBus extends ExtensionManagerBus 
-    implements ApplicationContextAware, ApplicationListener<ApplicationEvent> {
+    implements ApplicationContextAware {
 
     AbstractApplicationContext ctx;
     boolean closeContext;
@@ -75,11 +75,17 @@ public class SpringBus extends Extension
     /** {@inheritDoc}*/
     public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
         ctx = (AbstractApplicationContext)applicationContext;
-        ctx.addApplicationListener(this);
+        @SuppressWarnings("rawtypes")
+        ApplicationListener listener = new ApplicationListener() {
+            public void onApplicationEvent(ApplicationEvent event) {
+                SpringBus.this.onApplicationEvent(event);
+            }
+        };
+        ctx.addApplicationListener(listener);
         ApplicationContext ac = applicationContext.getParent();
         while (ac != null) {
             if (ac instanceof AbstractApplicationContext) {
-                ((AbstractApplicationContext)ac).addApplicationListener(this);
+                ((AbstractApplicationContext)ac).addApplicationListener(listener);
             }
             ac = ac.getParent();
         }



Mime
View raw message