Details
-
Feature Request
-
Resolution: Done
-
Major
-
None
Description
See http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html
1. Import test project jbosstools-javaee/cdi/tests/org.jboss.tools.cdi.core.test/projects/weld1.1
2. Open Java source file src/test/TestExcluded.java and src/META-INF/beans.xml
Check satisfied and unsatisfied dependencies:
- @Inject Bean1 bean1 - is unsatisfied (has marker 'No bean is eligible for injection')
because beans.xml contains <weld:exclude name="exclude.p1.Bean1"/> - @Inject Bean2 bean2 - is satisfied (there is open-on for injected bean Bean2)
- @Inject Bean3 bean3 - is unsatisfied
because of <weld:exclude name="exclude.p2.*"/> - @Inject Bean4 bean4 - is satisfied
because package "exclude.p2.p3" is not excluded by <weld:exclude name="exclude.p2.*"/> - @Inject Bean5 bean5 and @Inject Bean6 bean6 are both unsatisfied
because of <weld:exclude name="exclude.p4.**"> which is active as all restrictions weld:if-class-available are fulfilled - @Inject Bean7 bean7 - is satisfied
because <weld:exclude name="exclude.p6.**"> is inactive.
Supported use-cases for <weld:exclude> are limited to use-cases for <exclude> in CDI, which does not support pattern, symbol ?, use of symbol * other than in suffixes .* and .**, etc.