Re: Providers ordering


Santiago Pericas-Geertsen
 


On May 25, 2017, at 10:40 AM, Sergey Beryozkin <sberyozkin@...> wrote:

Hi Santiago

In what other cases, apart from ensuring a mapper shipped with MVC (or other spec APIs depending on JAX-RS), we would want to support sorting two ExceptionMapper<SomeClass> ?

 That is the main use case AFICT. Any library/framework sitting on top of JAX-RS may need finer control over this. @Priority is already used for filters and interceptors, except that in this case the entire set is consider rather than just one —but there is precedence of using this annotation nonetheless.

 Conceptually, this is what I have in mind, for all providers:

 1. Gather list of candidates
 2. Filter list based on provider-specific predicate
 3. Sort resulting list based on priority
 4. Pick one or all depending on provider kind

— Santiago


Cheers, Sergey
 
On 25/05/17 15:01, Santiago Pericas-Geertsen wrote:

On May 25, 2017, at 2:41 AM, Markus KARG <markus@...> wrote:

I do not see that we cannot change this. If we decide that a new, optional annotation will modify the precedence, this would be perfectly backwards compatible, as all non-annotated code will still work correctly.


 By an annotation you mean something like @PreferBuiltinProviders? I don’t see how that addresses the requirements outlined in JIRA 537.

— Santiago



Join jaxrs-spec@javaee.groups.io to automatically receive all group messages.