cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Local transport between isolated spring contexts
Date Fri, 28 Aug 2009 19:33:23 GMT
On Thu August 27 2009 12:57:04 pm Frajdek wrote:
> Hi
>
> I have one module, which should by isolated. I want to run in separate
> spring context, so beans from that module will not be available in my
> context. Basically I create new bean ClassPathXmlApplicationContext with
> all context files which should be isolated. The problem which I have is
> that I want to start server in that conext and run client in my main
> context. I want to use local transport, but it does not work when contexts
> are separated  Are there any solutions?
>
> Thanks in advance for help!

After you start the first context with the service in it and before invoking 
any service from the second, you could try something along the lines of:

Bus bus = (Bus)ctx1.getBean("cxf");
bus.getExtension(ConduitInitiatorManager.class).getConduitInitiator(......)

to get the ConduitInitiator for the LocalTransport our of the first context. 
(the ... is the transport URI, probably, 
"http://cxf.apache.org/transports/local")

And then do the reverse with the second:

 (Bus)ctx2.getBean("cxf");
bus.getExtension(ConduitInitiatorManager.class).registerConduitInitiator(id, 
ci);


You MAY also need to do the same for the DestinationFactoryManager as well.   
Grab the local DestinationFactory from cxt1 and register it with the other.

Hope that helps!

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message