Skip to content

Commit

Permalink
CAMEL-2433 Camel CxfEndpoint should support the set the bus from URI
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/camel/branches/camel-1.x@905256 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
WillemJiang committed Feb 1, 2010
1 parent a9d9e06 commit 1f5b4b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -117,6 +117,10 @@ public CxfExchange createExchange(Message inMessage) {
return new CxfExchange(getCamelContext(), getExchangePattern(), inMessage);
}

public void setBus(Bus bus) {
this.bus = bus;
}

public Bus getBus() {
if (bus == null) {
bus = doGetBus();
Expand Down
Expand Up @@ -23,6 +23,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.common.util.StringUtils;
import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
Expand Down Expand Up @@ -110,7 +111,8 @@ public CxfSpringEndpointBean(ReflectionServiceFactoryBean factory) {

public void setApplicationContext(ApplicationContext ctx) throws BeansException {
if (getBus() == null) {
Bus bus = BusFactory.getDefaultBus();
SpringBusFactory busFactory = new SpringBusFactory(ctx);
Bus bus = busFactory.createBus();
setBus(bus);
}
BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(getBus(), ctx);
Expand Down

0 comments on commit 1f5b4b9

Please sign in to comment.