Skip to content

Specify @Priority on producers#699

Merged
manovotn merged 2 commits intojakartaee:mainfrom
Ladicek:producer-priority
Nov 28, 2023
Merged

Specify @Priority on producers#699
manovotn merged 2 commits intojakartaee:mainfrom
Ladicek:producer-priority

Conversation

@Ladicek
Copy link
Copy Markdown
Member

@Ladicek Ladicek commented Nov 9, 2023

Fixes #556

@Ladicek Ladicek added this to the CDI 4.1 milestone Nov 9, 2023
@Ladicek Ladicek requested a review from manovotn November 9, 2023 16:54
@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented Nov 9, 2023

Submitting as a draft because I need to think a little more about this formulation:

To determine the priority of a producer method or field, the @Priority annotation on the producer method or field is considered first.
If the producer method or field does not declare the @Priority annotation, the @Priority annotation declared on the bean class is used.

The question is: should this be a general principle, or should this only be taken into account during ambiguity resolution? (The CDI specification doesn't use the priority for anything else, but I know of implementations that do use the priority value of beans e.g. for ordering.)

@manovotn
Copy link
Copy Markdown
Contributor

Submitting as a draft because I need to think a little more about this formulation

Can we swap this from draft to ready for review?
I think the current formulation is precise and would work fine.

@Ladicek Ladicek marked this pull request as ready for review November 28, 2023 13:34
@Ladicek
Copy link
Copy Markdown
Member Author

Ladicek commented Nov 28, 2023

Yeah, I totally forgot I updated this PR with a more targeted text.

@manovotn manovotn merged commit 17864f3 into jakartaee:main Nov 28, 2023
@Ladicek Ladicek deleted the producer-priority branch November 28, 2023 14:38
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

Successfully merging this pull request may close these issues.

@Priority on producers

3 participants