Multiple Java SE Containers
by Markus KARG
CDI 13.1 says: "An implementation does not need to support multiple calls of
SeContainerInitializer.initialize() method when the SeContainer is running."
If a Java SE application wants to create distinct Containers containing
beans from the same JAR library, this effectively means, it MUST create
multiple initializers, but the initializers MAY share the same default
ClassLoader, OR does that means that each initializer MUST be given a
separate ClassLoader, OR does that mean that it is IMPOSSIBLE to create
multiple SeContainers at the same time?
Thanks for clarification!
-Markus
6 years, 4 months
[JBoss JIRA] (CDI-734) Clarify whether SeContainerInitializer#disableDiscovery() also disables automatic CDI Extension pickup
by Mark Struberg (JIRA)
Mark Struberg created CDI-734:
---------------------------------
Summary: Clarify whether SeContainerInitializer#disableDiscovery() also disables automatic CDI Extension pickup
Key: CDI-734
URL: https://issues.jboss.org/browse/CDI-734
Project: CDI Specification Issues
Issue Type: Clarification
Components: Portable Extensions
Affects Versions: 2.0.SP1
Reporter: Mark Struberg
Priority: Minor
The wording in SeContainerInitializer is a bit ambiguous whether CDI Extensions should still automatically get detected if SeContainerInitializer#disableDiscovery() got called.
The spec just talks about "internal synthetic bean archive".
And the JavaDoc says "By default, the discovery is enabled so that all beans from all discovered bean archives are considered." So again also just beans.
Both wordings give the impression that CDI Extensions (which don't use scanning but java.util.ServiceLoader) might still work.
Otoh the JavaDoc contains the sentence "Moreover, it's also possible to disable the discovery completely so that only the "synthetic" bean archive is considered:" which contains "disable the discovery completely".
Both options are fine for me, but in hindsight of portability it might be wise to clarify it.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 4 months