When you explicitely create the Bus, you have a lot more control over things
than when you don't. When you create your own bus, you can import just the
things you need, configure things differently, etc.... If you don't create
your own, then we pretty much grab everything and wire it together. That's a
bit slower and will use a little more memory as it loads a lot more things.
HOWEVER, using the default bus is a lot easier. You know everything is
available. Example: You don't need to know to import META-INF/cxf/cxf-
extension-rm.xml to get WS-RM to work. It "just works".
Thus, it's an "ease of use" vs. "footprint/speed" type tradeoff.
Dan
On Thursday 13 January 2011 9:42:03 am Maatari wrote:
> Can someone explain me what is the purpose of this code:
>
> //public void deliver(......)
>
> ClientFactoryBean factory = new ClientFactoryBean();
> factory.setBus(outBus);
> factory.setBindingId(soapBinding);
> factory.setServiceClass(JadeWSImpl.class);
> factory.setAddress(epr);
> client = factory.create();
>
> What I do not comprehend are those two lines:
>
>
> factory.setBus(outBus);
> factory.setBindingId(soapBinding);
>
>
> More up in the code in another function we have something like
>
>
> private void activateClient() {
> if(outBus == null) {
> outBus = (new SpringBusFactory()).createBus(outConfFile);
> logger.info("Activated client bus: " + outBus);
> } else {
> logger.info("Client bus already activated: " + outBus);
> }
> }
>
> What is the bus necessary to initialize for ????
--
Daniel Kulp
[email protected]
http://dankulp.com/blog