I am learning weld.
And when I study the source code of org.jboss.weld.environment.se.Weld class
it mention synthetic bean archive several times in comment. It seemed it have thing with beans.xml.
I guess it is used to tell container load beans specified by manually and at this case we dont need beans.xml, but that is only my conjecture
then who can tell me how to understand synthetic bean archive?
everything will be appreciated.
Synthetic bean archives are being formalized in CDI 2.0, though impls may use the notion now in a non-portable way. Docs are in the CDI 2.0-EDR2
Basically, the synthetic bean archive represents the subset of beans that have been loaded while initializing the CDI container. Assuming you have enabled discovery and just use
initialize()
from Weld, the synthetic bean archive contains the superset of all JAR files on the classpath, using standard bean discovery rules - except that archives withoutbeans.xml
are excluded.If you disable discovery and programmatically add beans, the synthetic bean archive represents only those beans that you programmatically added.