cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1084811 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/core/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/test/java/org/apache/cxf/bus/spring/ rt/frontend/jaxrs/src/main/java/org/apache...
Date Thu, 24 Mar 2011 00:06:49 GMT
Author: dkulp
Date: Thu Mar 24 00:06:48 2011
New Revision: 1084811

URL: http://svn.apache.org/viewvc?rev=1084811&view=rev
Log:
Cleanup a bunch of things in the Spring bus referencing which allows a
single application to MUCH better support having multiple bus' defined

Added:
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml   (with props)
Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
    cxf/trunk/rt/core/pom.xml
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
    cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -56,6 +56,7 @@ import org.springframework.util.StringUt
 public abstract class AbstractBeanDefinitionParser 
     extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser {
     public static final String WIRE_BUS_ATTRIBUTE = AbstractBeanDefinitionParser.class.getName()
+ ".wireBus";
+    public static final String WIRE_BUS_NAME = AbstractBeanDefinitionParser.class.getName()
+ ".wireBusName";
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractBeanDefinitionParser.class);
     
     private Class beanClass;
@@ -211,9 +212,19 @@ public abstract class AbstractBeanDefini
         return DOMUtils.getFirstElement(element);
     }
 
-    protected void addBusWiringAttribute(BeanDefinitionBuilder bean, BusWiringType type)
{
+    protected void addBusWiringAttribute(BeanDefinitionBuilder bean, 
+                                         BusWiringType type) {
+        addBusWiringAttribute(bean, type, null);
+    }
+                                         
+    protected void addBusWiringAttribute(BeanDefinitionBuilder bean, 
+                                         BusWiringType type,
+                                         String busName) {
         LOG.fine("Adding " + WIRE_BUS_ATTRIBUTE + " attribute " + type + " to bean " + bean);
         bean.getRawBeanDefinition().setAttribute(WIRE_BUS_ATTRIBUTE, type);
+        if (busName != null) {
+            bean.getRawBeanDefinition().setAttribute(WIRE_BUS_NAME, busName); 
+        }
     }
     
     protected void mapElementToJaxbProperty(Element parent, 

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -70,6 +70,10 @@ public abstract class AbstractFactoryBea
             } else if (!"id".equals(name) && !"name".equals(name) && isAttribute(pre,
name)) {
                 if ("bus".equals(name)) {
                     setBus = true;
+                    if (!val.startsWith("#")) {
+                        //bus attributes always need to be a reference
+                        val = "#" + val;
+                    }
                 }
                 mapAttribute(factoryBean, element, name, val);
             } 

Modified: cxf/trunk/rt/core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/pom.xml?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/core/pom.xml (original)
+++ cxf/trunk/rt/core/pom.xml Thu Mar 24 00:06:48 2011
@@ -32,22 +32,6 @@
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 
-    <!--build>
-      <plugins>
-            <plugin>
-                <artifactId>maven-jar-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>create-test-jar</id>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-      </plugins>
-    </build-->
-
     <dependencies>
 
         <dependency>

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusDefinitionParser.java Thu
Mar 24 00:06:48 2011
@@ -27,17 +27,16 @@ import java.util.concurrent.atomic.Atomi
 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.injection.NoJSR250Annotations;
 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.AbstractBasicInterceptorProvider;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.message.Message;
 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;
@@ -53,11 +52,12 @@ public class BusDefinitionParser extends
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
         String bus = element.getAttribute("bus");        
         if (StringUtils.isEmpty(bus)) {
-            addBusWiringAttribute(bean, BusWiringType.CONSTRUCTOR);
+            addBusWiringAttribute(bean, BusWiringType.PROPERTY);
         } else {
-            bean.addConstructorArgReference(bus);
-            element.removeAttribute("bus");
+            addBusWiringAttribute(bean, BusWiringType.PROPERTY, bus);
         }
+        element.removeAttribute("bus");
+        bean.addConstructorArgValue(bus);
         bean.setLazyInit(false);
         super.doParse(element, ctx, bean);
     }
@@ -86,72 +86,142 @@ public class BusDefinitionParser extends
         return id;
     }
     @NoJSR250Annotations
-    public static class BusConfig implements ApplicationContextAware {
+    public static class BusConfig extends AbstractBasicInterceptorProvider
+        implements ApplicationContextAware {
+        
         CXFBusImpl bus;
-        boolean defaultBus;
-        public BusConfig() {
-            bus = (CXFBusImpl)BusFactory.getDefaultBus();
-            defaultBus = true;
-        }
+        String busName;
+        Collection<AbstractFeature> features;
+        Map<String, Object> properties;
         
-        public BusConfig(Bus b) {
-            bus = (CXFBusImpl)b;
+        public BusConfig(String busName) {
+            this.busName = busName;
         }
         
+        public void setBus(Bus bb) {
+            CXFBusImpl b = (CXFBusImpl)bb;
+            if (features != null) {
+                b.setFeatures(features);
+                features = null;
+            }
+            if (properties != null) {
+                b.setProperties(properties);
+                properties = null;
+            }
+            if (!getInInterceptors().isEmpty()) {
+                b.setInInterceptors(getInInterceptors());
+            }
+            if (!getOutInterceptors().isEmpty()) {
+                b.setOutInterceptors(getOutInterceptors());
+            }
+            if (!getInFaultInterceptors().isEmpty()) {
+                b.setInFaultInterceptors(getInFaultInterceptors());
+            }
+            if (!getOutFaultInterceptors().isEmpty()) {
+                b.setOutFaultInterceptors(getOutFaultInterceptors());
+            }
+            bus = b;
+        }
+
         public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
{
-            if (defaultBus
-                && applicationContext.getAutowireCapableBeanFactory() instanceof
ConfigurableBeanFactory) {
-                ConfigurableBeanFactory bf = (ConfigurableBeanFactory)applicationContext
-                    .getAutowireCapableBeanFactory();
-                bf.registerSingleton("cxf", bus);
+            if (bus != null) {
+                return;
+            }
+            if (busName == null) {
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(applicationContext));
+            } else {
+                setBus(BusWiringBeanFactoryPostProcessor.addBus(applicationContext, busName));
               
             }
         }
         
         public List<Interceptor<? extends Message>> getOutFaultInterceptors()
{
-            return bus.getOutFaultInterceptors();
+            if (bus != null) {
+                return bus.getOutFaultInterceptors();
+            }
+            return super.getOutFaultInterceptors();
         }
 
         public List<Interceptor<? extends Message>> getInFaultInterceptors()
{
-            return bus.getInFaultInterceptors();
+            if (bus != null) {
+                return bus.getInFaultInterceptors();
+            }
+            return super.getInFaultInterceptors();
         }
 
         public List<Interceptor<? extends Message>> getInInterceptors() {
-            return bus.getInInterceptors();
+            if (bus != null) {
+                return bus.getInInterceptors();
+            }
+            return super.getInInterceptors();
         }
 
         public List<Interceptor<? extends Message>> getOutInterceptors() {
-            return bus.getOutInterceptors();
+            if (bus != null) {
+                return bus.getOutInterceptors();
+            }
+            return super.getOutInterceptors();
         }
 
         public void setInInterceptors(List<Interceptor<? extends Message>> interceptors)
{
-            bus.setInInterceptors(interceptors);
+            if (bus != null) {
+                bus.setInInterceptors(interceptors);
+            } else {
+                super.setInInterceptors(interceptors);
+            }
         }
 
         public void setInFaultInterceptors(List<Interceptor<? extends Message>>
interceptors) {
-            bus.setInFaultInterceptors(interceptors);
+            if (bus != null) {
+                bus.setInFaultInterceptors(interceptors);
+            } else {
+                super.setInFaultInterceptors(interceptors);
+            }
         }
 
         public void setOutInterceptors(List<Interceptor<? extends Message>> interceptors)
{
-            bus.setOutInterceptors(interceptors);
+            if (bus != null) {
+                bus.setOutInterceptors(interceptors);
+            } else {
+                super.setOutInterceptors(interceptors);
+            }
         }
 
         public void setOutFaultInterceptors(List<Interceptor<? extends Message>>
interceptors) {
-            bus.setOutFaultInterceptors(interceptors);
+            if (bus != null) {
+                bus.setOutFaultInterceptors(interceptors);
+            } else {
+                super.setOutFaultInterceptors(interceptors);
+            }
         }
         
         public Collection<AbstractFeature> getFeatures() {
-            return bus.getFeatures();
+            if (bus != null) {
+                return bus.getFeatures();
+            }
+            return features;
         }
 
         public void setFeatures(Collection<AbstractFeature> features) {
-            bus.setFeatures(features);
+            if (bus != null) {
+                bus.setFeatures(features);
+            } else {
+                this.features = features;
+            }
+            
         }
         
         public Map<String, Object> getProperties() {
-            return bus.getProperties();
+            if (bus != null) {
+                return bus.getProperties();
+            } 
+            return properties;
         }
         public void setProperties(Map<String, Object> s) {
-            bus.setProperties(s);
+            if (bus != null) {
+                bus.setProperties(s);
+            } else {
+                this.properties = s;
+            }
         }
 
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
Thu Mar 24 00:06:48 2011
@@ -22,14 +22,10 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.configuration.spring.BusWiringType;
-import org.apache.cxf.configuration.spring.ConfigurerImpl;
 import org.apache.cxf.helpers.CastUtils;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -38,6 +34,8 @@ import org.springframework.beans.factory
 import org.springframework.beans.factory.config.ConstructorArgumentValues;
 import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
 import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.support.RootBeanDefinition;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
 
@@ -49,13 +47,11 @@ import org.springframework.context.Confi
  * arguments one place to the right and adds a reference to "cxf" as the first constructor
argument. This
  * processor is intended to operate on beans defined via Spring namespace support which require
a reference to
  * the CXF bus.
- * 
- * @author Ian Roberts
  */
 public class BusWiringBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
 
-    private static final Logger LOG = LogUtils.getL7dLogger(BusWiringBeanFactoryPostProcessor.class);
     Bus bus;
+    String busName;
     
     public BusWiringBeanFactoryPostProcessor() {
     }
@@ -63,26 +59,62 @@ public class BusWiringBeanFactoryPostPro
     public BusWiringBeanFactoryPostProcessor(Bus b) {
         bus = b;
     }
+    public BusWiringBeanFactoryPostProcessor(String n) {
+        busName = n;
+    }
+    private static Bus getBusForName(String name,
+                                        ApplicationContext context) {
+        if (!context.containsBean(name)) {
+            SpringBus b = new SpringBus();
+            b.setApplicationContext(context);
+            ConfigurableApplicationContext cctx = (ConfigurableApplicationContext)context;
+            cctx.getBeanFactory().registerSingleton(name, b);
+        }
+        return context.getBean(name, Bus.class);
+    }
+    private Object getBusForName(String name,
+                                        ConfigurableListableBeanFactory factory) {
+        if (!factory.containsBeanDefinition(name)) {
+            DefaultListableBeanFactory df = (DefaultListableBeanFactory)factory;
+            df.registerBeanDefinition(name, 
+                                      new RootBeanDefinition(SpringBus.class));
+        }
+        return new RuntimeBeanReference(name);        
+    }
+    
     public void postProcessBeanFactory(ConfigurableListableBeanFactory factory) throws BeansException
{
         Object inject = bus;
-        if (factory.containsBeanDefinition(Bus.DEFAULT_BUS_ID)) {
-            inject = new RuntimeBeanReference(Bus.DEFAULT_BUS_ID);
+        if (inject == null) {
+            inject = getBusForName(Bus.DEFAULT_BUS_ID, factory);
+        } else {
+            if (!factory.containsBeanDefinition(Bus.DEFAULT_BUS_ID)
+                && !factory.containsSingleton(Bus.DEFAULT_BUS_ID)) {
+                factory.registerSingleton(Bus.DEFAULT_BUS_ID, bus);
+            }
         }
         for (String beanName : factory.getBeanDefinitionNames()) {
-            LOG.fine("Checking bean " + beanName);
             BeanDefinition beanDefinition = factory.getBeanDefinition(beanName);
-            if (BusWiringType.PROPERTY == beanDefinition
-                .getAttribute(AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE)) {
-                LOG.fine("Found " + AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE + " attribute
"
-                         + BusWiringType.PROPERTY + " on bean " + beanName);
+            BusWiringType type 
+                = (BusWiringType)beanDefinition.getAttribute(AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE);
+            if (type == null) {
+                continue;
+            }
+            String busname = (String)beanDefinition.getAttribute(AbstractBeanDefinitionParser.WIRE_BUS_NAME);
+            Object inj = inject;
+            if (busname != null) {
+                if (bus != null) {
+                    continue;
+                }
+                inj = getBusForName(busname, factory);
+            }
+            beanDefinition.removeAttribute(AbstractBeanDefinitionParser.WIRE_BUS_NAME);
+            beanDefinition.removeAttribute(AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE);
+            if (BusWiringType.PROPERTY == type) {
                 beanDefinition.getPropertyValues()
-                    .addPropertyValue("bus", inject);
-            } else if (BusWiringType.CONSTRUCTOR == beanDefinition
-                .getAttribute(AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE)) {
-                LOG.fine("Found " + AbstractBeanDefinitionParser.WIRE_BUS_ATTRIBUTE + " attribute
"
-                         + BusWiringType.CONSTRUCTOR + " on bean " + beanName);
+                    .addPropertyValue("bus", inj);
+            } else if (BusWiringType.CONSTRUCTOR == type) {
                 ConstructorArgumentValues constructorArgs = beanDefinition.getConstructorArgumentValues();
-                insertConstructorArg(constructorArgs, inject);
+                insertConstructorArg(constructorArgs, inj);
             }
         }
     }
@@ -112,14 +144,17 @@ public class BusWiringBeanFactoryPostPro
         constructorArgs.addIndexedArgumentValue(0, valueToInsert);
     }
     
-    public static void updateBusReferencesInContext(Bus bus, ApplicationContext ctx) {
-        Configurer conf = bus.getExtension(Configurer.class);
-        if (conf instanceof ConfigurerImpl) {
-            ((ConfigurerImpl)conf).addApplicationContext(ctx);
-        }
-        if (ctx instanceof ConfigurableApplicationContext) {
-            ConfigurableApplicationContext cctx = (ConfigurableApplicationContext)ctx;
-            new BusWiringBeanFactoryPostProcessor(bus).postProcessBeanFactory(cctx.getBeanFactory());
+    public static Bus addDefaultBus(ApplicationContext ctx) {
+        if (!ctx.containsBean(Bus.DEFAULT_BUS_ID)) {
+            Bus b = getBusForName(Bus.DEFAULT_BUS_ID, ctx);
+            if (ctx instanceof ConfigurableApplicationContext) {
+                ConfigurableApplicationContext cctx = (ConfigurableApplicationContext)ctx;
+                new BusWiringBeanFactoryPostProcessor(b).postProcessBeanFactory(cctx.getBeanFactory());
+            }
         }
+        return ctx.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
+    }
+    public static Bus addBus(ApplicationContext ctx, String name) {
+        return getBusForName(name, ctx);
     }
 }

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
(original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/BusDefinitionParserTest.java
Thu Mar 24 00:06:48 2011
@@ -86,7 +86,25 @@ public class BusDefinitionParserTest ext
             }
         }
     }
-
+    @Test
+    public void testBusConfigureCreateBus() {
+        ClassPathXmlApplicationContext context = null;
+        try {
+            context = new ClassPathXmlApplicationContext("org/apache/cxf/bus/spring/customerBus2.xml");
+            Bus cxf1 = (Bus)context.getBean("cxf1");
+            
+            assertTrue(cxf1.getOutInterceptors().size() == 1);
+            assertTrue(cxf1.getInInterceptors().size() == 0);
+            
+            Bus cxf2 = (Bus)context.getBean("cxf2");
+            assertTrue(cxf2.getInInterceptors().size() == 1);
+            assertTrue(cxf2.getOutInterceptors().size() == 0);
+        } finally {
+            if (context != null) {
+                context.close();
+            }
+        }
+    }
     @Test
     public void testLazyInit() {
         String cfgFile = "org/apache/cxf/bus/spring/lazyInitBus.xml";

Added: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml?rev=1084811&view=auto
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml (added)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml Thu Mar 24
00:06:48 2011
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:cxf="http://cxf.apache.org/core"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
+
+   <cxf:bus bus="cxf1">
+        <cxf:outInterceptors>
+        <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxf:outInterceptors>
+    </cxf:bus>
+
+    <cxf:bus bus="cxf2">
+        <cxf:inInterceptors>
+        <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxf:inInterceptors>
+    </cxf:bus>
+  
+
+</beans>

Propchange: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/customerBus2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -25,8 +25,6 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.configuration.spring.AbstractFactoryBeanDefinitionParser;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -107,9 +105,7 @@ public class JAXRSClientFactoryBeanDefin
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -26,8 +26,6 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
@@ -165,9 +163,7 @@ public class JAXRSServerFactoryBeanDefin
                 super.setResourceProviders(factories);
             }
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -28,7 +28,6 @@ import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
@@ -192,9 +191,7 @@ public class EndpointDefinitionParser ex
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -18,8 +18,6 @@
  */
 package org.apache.cxf.jaxws.spring;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.frontend.ClientFactoryBean;
@@ -68,9 +66,7 @@ public class JaxWsProxyFactoryBeanDefini
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
         public Object create() {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java
Thu Mar 24 00:06:48 2011
@@ -18,8 +18,6 @@
  */
 package org.apache.cxf.jaxws.spring;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.spring.StringBeanDefinitionParser;
@@ -60,9 +58,7 @@ public class NamespaceHandler extends Na
         }
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Thu Mar 24 00:06:48 2011
@@ -297,7 +297,7 @@ public class SpringBeansTest extends Ass
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/clients.xml"});
 
         ClientHolderBean greeters = (ClientHolderBean)ctx.getBean("greeters");
-        assertEquals(3, greeters.greeterCount());
+        assertEquals(4, greeters.greeterCount());
         
         Object bean = ctx.getBean("client1.proxyFactory");
         assertNotNull(bean);
@@ -378,6 +378,25 @@ public class SpringBeansTest extends Ass
         }
         fail("Did not configure the client");
     }
+    @Test
+    public void testClientUsingDifferentBus() throws Exception {
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/clients.xml"});
+        Greeter greeter = (Greeter) ctx.getBean("differentBusGreeter");
+        assertNotNull(greeter);
+        Client client = ClientProxy.getClient(greeter);
+        assertEquals("snarf", client.getBus().getProperty("foo"));
+
+        Greeter greeter1 = (Greeter) ctx.getBean("client1");
+        assertNotNull(greeter1);
+        Client client1 = ClientProxy.getClient(greeter1);
+        assertEquals("barf", client1.getBus().getProperty("foo"));
+        Greeter greeter2 = (Greeter) ctx.getBean("wsdlLocation");
+        assertNotNull(greeter2);
+        Client client2 = ClientProxy.getClient(greeter2);
+        assertSame(client1.getBus(), client2.getBus());
+
+    }
 
 }
 

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml Thu
Mar 24 00:06:48 2011
@@ -15,13 +15,15 @@
 		License.
 	-->
 <beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:cxf="http://cxf.apache.org/core"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
 	xmlns:soap="http://cxf.apache.org/bindings/soap" 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://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
-http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
 
 	<context:annotation-config />
 
@@ -98,4 +100,23 @@ http://cxf.apache.org/jaxws http://cxf.a
             <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
         </jaxws:inInterceptors>
     </jaxws:client>
+    
+    <!-- this configures the default bus "cxf" -->
+    <cxf:bus>
+        <cxf:properties>
+            <entry key="foo" value="barf"/>
+        </cxf:properties>
+    </cxf:bus>
+    
+    <!-- This will create a new bus named "FooSnarf" and configure it -->
+    <cxf:bus bus="FooSnarf">
+        <cxf:properties>
+            <entry key="foo" value="snarf"/>
+        </cxf:properties>
+    </cxf:bus>
+    <jaxws:client id="differentBusGreeter"
+        bus="FooSnarf"
+        serviceClass="org.apache.hello_world_soap_http.Greeter" address="http://localhost:9000/foo"
+        serviceName="s:SOAPService" xmlns:s="http://apache.org/hello_world_soap_http">
+    </jaxws:client>
 </beans>

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -25,8 +25,6 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.spring.AbstractFactoryBeanDefinitionParser;
@@ -106,9 +104,7 @@ public class ClientProxyFactoryBeanDefin
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
         public Object create() {

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -25,8 +25,6 @@ import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.util.StringUtils;
@@ -131,9 +129,7 @@ public class ServerFactoryBeanDefinition
 
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -30,7 +30,6 @@ import javax.xml.bind.JAXBContext;
 import org.w3c.dom.Element;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
@@ -177,9 +176,7 @@ public class JettyHTTPServerEngineBeanDe
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
         

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
Thu Mar 24 00:06:48 2011
@@ -26,7 +26,6 @@ import javax.xml.namespace.QName;
 import org.w3c.dom.Element;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.common.util.StringUtils;
@@ -155,9 +154,7 @@ public class JettyHTTPServerEngineFactor
         
         public void setApplicationContext(ApplicationContext ctx) throws BeansException {
             if (getBus() == null) {
-                Bus bus = BusFactory.getThreadDefaultBus();
-                BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
-                setBus(bus);
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
             }
         }
     }

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
Thu Mar 24 00:06:48 2011
@@ -133,7 +133,7 @@ public class CXFServlet extends Abstract
          */
         if (ctx == null) {            
             LOG.info("LOAD_BUS_WITHOUT_APPLICATION_CONTEXT");
-            bus = new SpringBusFactory().createBus();
+            bus = new SpringBusFactory().createBus(new String[0]);
             ctx = bus.getExtension(BusApplicationContext.class);
         } else {
             LOG.info("LOAD_BUS_WITH_APPLICATION_CONTEXT");

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java?rev=1084811&r1=1084810&r2=1084811&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
(original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
Thu Mar 24 00:06:48 2011
@@ -156,22 +156,7 @@ public class InterceptorFaultTest extend
         
         setupGreeter("org/apache/cxf/systest/interceptor/no-addr.xml", false);
 
-        // all interceptors pass
-
-        /*
-        greeter.greetMeOneWay("one");
-        assertEquals("TWO", greeter.greetMe("two"));
-        try {
-            greeter.pingMe();
-            fail("Expected PingMeFault not thrown.");
-        } catch (PingMeFault f) {
-            assertEquals(20, (int)f.getFaultInfo().getMajor());
-            assertEquals(10, (int)f.getFaultInfo().getMinor());
-        }
-        */
-
         // behaviour is identicial for all phases
-        
         Iterator<Phase> it = inPhases.iterator();
         Phase p = null;
         FaultLocation location = new org.apache.cxf.greeter_control.types.ObjectFactory()
@@ -192,7 +177,6 @@ public class InterceptorFaultTest extend
         setupGreeter("org/apache/cxf/systest/interceptor/addr.xml", false);
 
         // all interceptors pass
-
         greeter.greetMeOneWay("one");
         assertEquals("TWO", greeter.greetMe("two"));
         try {
@@ -247,7 +231,6 @@ public class InterceptorFaultTest extend
         
         control.setFaultLocation(location);       
        
-        String expectedMsg = getExpectedInterceptorFaultMessage(location.getPhase());
 
         // oneway reports a plain fault (although server sends a soap fault)
 
@@ -266,6 +249,7 @@ public class InterceptorFaultTest extend
             assertEquals(FAULT_MESSAGE, ex.getMessage());
         }
         
+        String expectedMsg = getExpectedInterceptorFaultMessage(location.getPhase());
         try {
             greeter.greetMe("cxf");
             fail("Twoway operation unexpectedly succeded.");



Mime
View raw message