cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r813941 - in /cxf/branches/2.1.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Date Fri, 11 Sep 2009 17:36:11 GMT
Author: dkulp
Date: Fri Sep 11 17:36:11 2009
New Revision: 813941

URL: http://svn.apache.org/viewvc?rev=813941&view=rev
Log:
Merged revisions 813902 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r813902 | dkulp | 2009-09-11 12:10:40 -0400 (Fri, 11 Sep 2009) | 10 lines
  
  Merged revisions 812736 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r812736 | dkulp | 2009-09-08 20:35:29 -0400 (Tue, 08 Sep 2009) | 2 lines
    
    if <cxf:bus> is used in a context that doesn't define a bus, go ahead
    and create a default bus and wire it into the context
  ........
................

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/BusDefinitionParser.java

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/BusDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?rev=813941&r1=813940&r2=813941&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
Fri Sep 11 17:36:11 2009
@@ -26,14 +26,19 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.CXFBusImpl;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.interceptor.Interceptor;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
 
 public class BusDefinitionParser extends AbstractBeanDefinitionParser {
 
@@ -75,12 +80,27 @@
         return id;
     }
     
-    public static class BusConfig  {
+    public static class BusConfig implements ApplicationContextAware {
         CXFBusImpl bus;
+        boolean defaultBus;
+        public BusConfig() {
+            bus = (CXFBusImpl)BusFactory.getDefaultBus();
+            defaultBus = true;
+        }
         
         public BusConfig(Bus b) {
             bus = (CXFBusImpl)b;
         }
+        
+        public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
+            if (defaultBus
+                && applicationContext.getAutowireCapableBeanFactory() instanceof
ConfigurableBeanFactory) {
+                ConfigurableBeanFactory bf = (ConfigurableBeanFactory)applicationContext
+                    .getAutowireCapableBeanFactory();
+                bf.registerSingleton("cxf", bus);
+            }
+        }
+        
         public List<Interceptor> getOutFaultInterceptors() {
             return bus.getOutFaultInterceptors();
         }
@@ -128,5 +148,6 @@
             bus.setProperties(s);
         }
 
+
     }
 }



Mime
View raw message