[ 
https://issues.apache.org/jira/browse/CXF-5970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14130313#comment-14130313
 ] 

Sergey Beryozkin commented on CXF-5970:
---------------------------------------

I added a 'providerComparator' property which can be used to do a custom sort 
of custom readers or writers, such comparator, if set, has to accept Objects 
and then cast internally. For now it would work for sorting MBR/MBW but in the 
future may be for sorting filters too. 
Using this comparator would most likely lead to a non-compliant runtime 
behaviour but I agree that some 3rd party providers can 'mislead' the runtime 
they can support a given type and then fail thus not giving a chance to some 
other custom provider. So it should only be used when absolutely needed :-)

Cheers, Sergey 

> review org.apache.cxf.jaxrs.provider.ProviderFactory.Message*ReaderComparator
> -----------------------------------------------------------------------------
>
>                 Key: CXF-5970
>                 URL: https://issues.apache.org/jira/browse/CXF-5970
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Romain Manni-Bucau
>            Assignee: Sergey Beryozkin
>             Fix For: NeedMoreInfo
>
>
> Actually the task can be rephrase saying rework 
> org.apache.cxf.jaxrs.provider.ProviderFactory#*Comparators
> Current implementations don't seem to have an absolute order which means 
> sorting is not as deterministic as it should be under java >= 7.
> Other point is as a user you set a List of providers (you probably already 
> sorted if important) so you want to ensure *your* order is respected at 
> runtime (ie 
> org.apache.cxf.jaxrs.provider.ProviderFactory#message[Readers|Writers] 
> respect it).
> If you think this sorting is important maybe introducing in 
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean and 
> org.apache.cxf.jaxrs.provider.ProviderFactory a boolean sortProviders can be 
> enough to prevent calling sortXXX().



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to