views:

25

answers:

1

I would like to have a central weld container that holds all my services and so on. This container would however be wrapped by a second container which contains local settings. The goal is if a dependency cannot be found in the outer container then I would like to then search the inner container.

How can I achieve this? I would prefer to do things in a standlike manner, without reverting to use of non standard WELD extensions.

A: 

I don't think you can do this. There is one BeanManager, which resolves dependencies by looking if any if its Contexts (related to scopes) contains the desired dependency.

Bozho
BeanManager is not really a standard javax.inject class but rather a WELD implementation class. I suppose its an answer but then again using internal classses is never good. This is disappointing as i thoight the who;e point of CDI was standardization...
mP
I meant this is the way how CDI is supposed to function (based on the SPI). You aren't supposed to use SPI interfaces.
Bozho
Yes and tahts the shortfall. Its very static and does not offer a "dynamic" way.
mP