-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArC: make it possible to restrict the bean types of a synthetic bean #44887
Comments
I thought |
Not really, |
To me, the main question here is: should [1] registration.configure(DotName.createSimple("com.example.MyClass"))
.addType(com.example.MyInterface.class)
.addType(ParameterizedType.create(List.class, ClassType.create(String.class)))
.restrictTypes(MyInterface.class, List.class) would mean that the bean types of the synth bean would be [2] registration.configure(DotName.createSimple("com.example.MyClass"))
.restrictTypes(ClassType.create(MyInterface.class), ParameterizedType.create(List.class, ClassType.create(String.class))) would mean that the bean types of the synth bean would be |
+1 for the option [1]. It's more clear. Also it could be easily combined with automatic discovery - see #44888. |
I think Yoann has a point here. Or is there a benefit of having two different bean type sets that I am missing? |
You're right that It could be also very useful when used together with the What I like about this approach is that it mimics the behavior of |
This is the first thing I thought of as well |
Description
It should be possible to restrict the bean types of a synthetic bean with the same semantics as
@jakarta.enterprise.inject.Typed
.Currently, it's not possible to create a synthetic alternative to the following producer method:
Implementation ideas
Add the
restrictTypes()
method to the configurator API.The text was updated successfully, but these errors were encountered: