Skip to content
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

Open
t1 opened this issue Nov 6, 2017 · 9 comments
Open

Support @Stereotype #187

t1 opened this issue Nov 6, 2017 · 9 comments
Milestone

Comments

@t1
Copy link

t1 commented Nov 6, 2017

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.

@t1
Copy link
Author

t1 commented Nov 25, 2017

@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.

@Emily-Jiang
Copy link
Member

I will defer this one. However, I will add a statement on the spec to say "The stereotype support is optional."

@Emily-Jiang Emily-Jiang added this to the Future milestone Dec 6, 2017
@Emily-Jiang
Copy link
Member

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.

@t1
Copy link
Author

t1 commented Feb 20, 2018

@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?

@Emily-Jiang
Copy link
Member

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.

@t1
Copy link
Author

t1 commented Mar 2, 2018

Maybe I'm getting something wrong, but CDI Stereotypes can be used for Interceptors. See http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#specify_stereotype_interceptor_bindings

@Emily-Jiang
Copy link
Member

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.

@OndroMih
Copy link
Contributor

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.

@t1
Copy link
Author

t1 commented Mar 22, 2018

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 @Gateway stereotype annotation? I could change anything at the class or at the method level, but the defaults are there. I could not remove something, e.g. the timeout, but I could change it to any value.

I think this would be very valuable. Don't you agree?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants