[weld-dev] BeanManagerImpl permits multiple Contexts per scope type: why?

Laird Nelson ljnelson at gmail.com
Thu Nov 1 17:46:58 EDT 2018


I noticed that BeanManagerImpl permits many Contexts to be indexed under a
given scope type
<https://github.com/weld/core/blob/d8a8cb64f3a9751dcac07c8d9eda0dd3a0e682b8/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java#L663>.
Why is that?

The CDI 2.0 specification says
<http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#contexts>:

"Associated with every scope type is a context object."

I took "a context object" to mean "exactly one context object" but maybe
I'm mistaken?  Obviously Weld can do things outside of the specification
but I was curious what the use case might be here.

I do understand that certainly only one Context of a given scope type may
be active.  I was just curious why the container even permits many to be
registered.

Best,
Laird
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20181101/ea4c6a22/attachment.html 


More information about the weld-dev mailing list