-
Notifications
You must be signed in to change notification settings - Fork 81
support for synthetic bean injection points in Build Compatible Extensions #957
Description
Is your feature request related to a problem? Please describe.
In CDI 4.0 days, we added SyntheticBean[Creator|Disposer] that is given Instance<Object> for arbitrary lookup, simulating producer method parameters. This doesn't matter in fully runtime implementations, but in build time implementations, this is actually a burden. We would like to be closer to actual producer methods by declaring up front which injections the SyntheticBean[Creator|Disposer] uses, and it doesn't have access to anything else.
In other words, I believe what we added (what I added) in CDI 4.0 was a mistake and I'd like to fix that mistake.
Describe the solution you'd like
The SyntheticBeanBuilder gains a few overloads of withInjectionPoint(Class<?> type, Annotation... qualifiers).
The SyntheticBean[Creator|Disposer] get new overload of the create()/dispose() method that accept a type (e.g. SyntheticInjections) that provides access to injectable references for beans that were declared up front. The old overloads are deprecated for removal.
Describe alternatives you've considered
We could just stay on the original API and live with the mistake.