Hi Matt,
The bus would be created on the first call in your code path which
creates JaxWsProxyFactoryBean. If you want to Isolate it you will need
to create bus yourself and set the default bus to instance you created.
The code will look like this.
Bus bus = BusFactory.getDefaultBus();
This will return you the bus and also will remove the bus creation out
of your equation.
Regards,
Ulhas Bhole
MattJax wrote:
Thanks for your reply Daniel.
dkulp wrote:
... the above will create a Bus object that won't be released. The Bus is
the registry for all the plugins and stuff. However, creating the bus is
expensive so it's definitely not something you want to do each time if you
can avoid it so holding onto that is probably OK.
I'm not clear on where the bus is created in my snippet. I'd guess as part
of the factory.create(). This does indeed take a while the first time it is
used and I can see it do lots of initialising stuff (looking for the cxf.xml
etc). Subsequent uses of the factory.create() are pretty quick though.
How would I remove the Bus initialisation from the equation and move this
elsewhere? What's the recommended approach for this? This is being used in
an application which is not Spring-enabled, so a code-based approach would
be great.
Thanks in advance,
Matt
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland