camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Tam <email.w...@gmail.com>
Subject Re: svn commit: r883625 - in /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf: ./ spring/
Date Tue, 24 Nov 2009 15:36:09 GMT
HI Willem,

What is the implication of always creating a new Bus in doGetBus()?
There is an set "setDefaultBus" option in CXF endpoint.  Does the
"setDefaultBus" becomes meaningless now?  If so, should we deprecate
this option?

In CxfEndpoint which is not Spring aware, is it safe to create a Bus
by calling the SpringBusFactory?

Thanks,
William




> Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java?rev=883625&r1=883624&r2=883625&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
(original)
> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
Tue Nov 24 08:54:16 2009
> @@ -40,6 +40,7 @@
>  import org.apache.commons.logging.LogFactory;
>  import org.apache.cxf.Bus;
>  import org.apache.cxf.BusFactory;
> +import org.apache.cxf.bus.spring.SpringBusFactory;
>  import org.apache.cxf.common.classloader.ClassLoaderUtils;
>  import org.apache.cxf.common.util.ClassHelper;
>  import org.apache.cxf.endpoint.Client;
> @@ -189,7 +190,7 @@
>     }
>
>     protected Bus doGetBus() {
> -        return BusFactory.getThreadDefaultBus();
> +        return SpringBusFactory.newInstance().createBus();
>     }
>
>     /**
>
> Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java?rev=883625&r1=883624&r2=883625&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
(original)
> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfEndpointBeanDefinitionParser.java
Tue Nov 24 08:54:16 2009
> @@ -24,8 +24,8 @@
>  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.bus.spring.SpringBusFactory;
>  import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
>  import org.springframework.beans.BeansException;
>  import org.springframework.beans.factory.support.BeanDefinitionBuilder;
> @@ -33,8 +33,6 @@
>  import org.springframework.context.ApplicationContext;
>  import org.springframework.context.ApplicationContextAware;
>
> -
> -
>  public class CxfEndpointBeanDefinitionParser extends AbstractCxfBeanDefinitionParser
{
>
>     @Override
> @@ -93,7 +91,8 @@
>         public void setApplicationContext(ApplicationContext ctx) throws BeansException
{
>             applicationContext = ctx;
>             if (getBus() == null) {
> -                Bus bus = BusFactory.getThreadDefaultBus();
> +                // Don't relate on the DefaultBus
> +                Bus bus = SpringBusFactory.newInstance().createBus();
>                 setBus(bus);
>             }
>             BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(getBus(),
ctx);
>
> Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanDefinitionParser.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanDefinitionParser.java?rev=883625&r1=883624&r2=883625&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanDefinitionParser.java
(original)
> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsClientFactoryBeanDefinitionParser.java
Tue Nov 24 08:54:16 2009
> @@ -25,6 +25,7 @@
>  import org.apache.cxf.Bus;
>  import org.apache.cxf.BusFactory;
>  import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
> +import org.apache.cxf.bus.spring.SpringBusFactory;
>  import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
>  import org.apache.cxf.jaxrs.model.UserResource;
>  import org.apache.cxf.jaxrs.utils.ResourceUtils;
> @@ -81,7 +82,8 @@
>
>         public void setApplicationContext(ApplicationContext ctx) throws BeansException
{
>             if (getBus() == null) {
> -                Bus bus = BusFactory.getThreadDefaultBus();
> +                // Don't relate on the DefaultBus
> +                Bus bus = SpringBusFactory.newInstance().createBus();
>                 BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus,
ctx);
>                 setBus(bus);
>             }
>
> Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsServerFactoryBeanDefinitionParser.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsServerFactoryBeanDefinitionParser.java?rev=883625&r1=883624&r2=883625&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsServerFactoryBeanDefinitionParser.java
(original)
> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/CxfRsServerFactoryBeanDefinitionParser.java
Tue Nov 24 08:54:16 2009
> @@ -26,6 +26,7 @@
>  import org.apache.cxf.Bus;
>  import org.apache.cxf.BusFactory;
>  import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
> +import org.apache.cxf.bus.spring.SpringBusFactory;
>  import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
>  import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
>  import org.apache.cxf.jaxrs.model.UserResource;
> @@ -98,7 +99,8 @@
>
>         public void setApplicationContext(ApplicationContext ctx) throws BeansException
{
>             if (getBus() == null) {
> -                Bus bus = BusFactory.getThreadDefaultBus();
> +                // Don't relate on the DefaultBus
> +                Bus bus = SpringBusFactory.newInstance().createBus();
>                 BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus,
ctx);
>                 setBus(bus);
>             }
>
>
>

Mime
View raw message