cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1372938 - in /cxf/branches/2.4.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:48:41 GMT
Author: dkulp
Date: Tue Aug 14 15:48:40 2012
New Revision: 1372938

URL: http://svn.apache.org/viewvc?rev=1372938&view=rev
Log:
Merged revisions 1372933 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

........
  r1372933 | dkulp | 2012-08-14 11:45:21 -0400 (Tue, 14 Aug 2012) | 18 lines

  Merged revisions 1372929 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

  ........
    r1372929 | dkulp | 2012-08-14 11:39:44 -0400 (Tue, 14 Aug 2012) | 10 lines

    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.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java?rev=1372938&r1=1372937&r2=1372938&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContextResourceResolver.java
Tue Aug 14 15:48:40 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.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java?rev=1372938&r1=1372937&r2=1372938&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
Tue Aug 14 15:48:40 2012
@@ -178,7 +178,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);

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java?rev=1372938&r1=1372937&r2=1372938&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/OldSpringSupport.java
Tue Aug 14 15:48:40 2012
@@ -30,6 +30,7 @@ import org.springframework.beans.factory
 /**
  * 
  */
+@SuppressWarnings("rawtypes")
 public final class OldSpringSupport implements FactoryBean, BeanNameAware {
     public static final Logger LOG = LogUtils.getL7dLogger(OldSpringSupport.class);
     Bus bus;

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java?rev=1372938&r1=1372937&r2=1372938&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java
Tue Aug 14 15:48:40 2012
@@ -101,6 +101,18 @@ public class SpringBeanLocator implement
         }
     }
     
+    public <T> T getBeanOfType(String name, Class<T> type) {
+        T t = null;
+        try {
+            t = type.cast(context.getBean(name, type));
+        } catch (NoSuchBeanDefinitionException nsbde) {
+            //ignore
+        }
+        if (t == null) {
+            t = orig.getBeanOfType(name, type);
+        }
+        return t;
+    }
     
     /** {@inheritDoc}*/
     public List<String> getBeanNamesOfType(Class<?> type) {
@@ -120,7 +132,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.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java?rev=1372938&r1=1372937&r2=1372938&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBus.java
Tue Aug 14 15:48:40 2012
@@ -38,7 +38,7 @@ import org.springframework.context.suppo
  * 
  */
 public class SpringBus extends ExtensionManagerBus 
-    implements ApplicationContextAware, ApplicationListener {
+    implements ApplicationContextAware {
 
     AbstractApplicationContext ctx;
     boolean closeContext;
@@ -49,11 +49,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