You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Alessio Soldano <as...@redhat.com> on 2012/05/15 16:43:40 UTC

SpringBeanLocator and additional ApplicationContext instances

Hi,
I've an application that creates a Spring Bus and then add a child
context (GeneralApplicationContext) to the context that has been created
for the bus:

BusApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
...
reader.loadBeanDefinitions(...);
childCtx.refresh();

I'd like the SpringBeanLocator that's also installed by default in the
bus to be able to resolve beans I might have in the additional child
context. Does anybody have suggestions / best practices on how to do
that? I'm thinking about providing a custom bean locator, not sure if
that really is a good idea though...

Thanks
Alessio

-- 
Alessio Soldano
Web Service Lead, JBoss

Re: SpringBeanLocator and additional ApplicationContext instances

Posted by Alessio Soldano <as...@redhat.com>.
Nevermind, I'm changing the application to avoid using multiple contexts.
Cheers
Alessio

On 05/15/2012 04:43 PM, Alessio Soldano wrote:
> Hi,
> I've an application that creates a Spring Bus and then add a child
> context (GeneralApplicationContext) to the context that has been created
> for the bus:
> 
> BusApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
> GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
> XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
> ...
> reader.loadBeanDefinitions(...);
> childCtx.refresh();
> 
> I'd like the SpringBeanLocator that's also installed by default in the
> bus to be able to resolve beans I might have in the additional child
> context. Does anybody have suggestions / best practices on how to do
> that? I'm thinking about providing a custom bean locator, not sure if
> that really is a good idea though...
> 
> Thanks
> Alessio
> 


-- 
Alessio Soldano
Web Service Lead, JBoss