-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support @Stereotype
#187
Comments
@dblevins: I know you're a great supporter for meta-types. Don't you think requiring support for Stereotypes would be a good addition to fault-tolerance annotations? I'd like to have some support before I start to dig into this issue. |
I will defer this one. However, I will add a statement on the spec to say "The stereotype support is optional." |
We discussed this in today's hangout, here is what we found. Stereotype is used on beans or method producer or field producer, not the aggregation of interceptor binding. |
@Emily-Jiang: I don't understand what this means, I guess it would have been beneficial, if I was on the hangout :-( It would be very kind of you, if you could expand a little on the topic? |
Stereotype is only used for CDI beans, producer fields and producer methods. Unfortunately, you are asking for a metatype aggregation of interceptor bindings, which CDI cannot do. Stereotype cannot help in this circumstance. |
Maybe I'm getting something wrong, but CDI |
Stereotype has scope, interceptors, qualifier. Interceptors alone can make a Stereotype with a default scope of Dependent though no scope is mentioned. Stereotype is only used for producers. |
I'd like to clarify what @Emily-Jiang wrote: Stereotypes can be used only on producers and classes but on methods. So there's a value in supporting stereotypes but only as default configuration for all methods of a CDI bean. It should be clarified that putting a stereotype on a method would be ignored - only specific interceptor annotations can be used for methods. |
Okay, now I understand. This limitation of the CDI spec regarding stereotypes does restrict its usefulness, even when it never occurred to me before. I guess the main use-case is to define stereotypes on the class level anyway. When I have a bunch of gateway classes to encapsulate the access to remote systems that I want to protect with FT, wouldn't it be useful to define the default FT behaviour in a I think this would be very valuable. Don't you agree? |
The FT spec doesn't mention Stereotypes, so there is no test in the TCK and implementations don't have to support it.
It would be useful to, e.g., define a
@Stereotype
-annotation@Gateway
with the complete default FT handling and use it for all gateway classes.As a fallback it should at least be explicitly documented as not supported.
The text was updated successfully, but these errors were encountered: