cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6514) endpoints returning String can't use a custom provider
Date Tue, 04 Aug 2015 15:57:04 GMT

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

Sergey Beryozkin commented on CXF-6514:
---------------------------------------

See, the custom providers are still checked, for example, if you get MyProvider<String>
then it will definitely win against the default one. 

The difference now is that both default and custom providers are considered even if a matching
custom provider is available.  Before it was like this: if a custom provider is available
then do not even check the default ones. But now the default and custom ones are added into
a common collection and sorted and if we have equal candidates then the custom provider is
added on top; next at the runtime we start from the top of the list and the first matching
provider which returns boolean from isWriteable is selected... It is still the case that the
custom provider wins if a default provider also matches but is no more specific that the custom
one.

The earlier mechanism was support by having a parent factory with the default providers and
the child factory with the custom providers, if no custom providers are available then delegate
to the parent one. Now we have a single factory without any delegations.




> endpoints returning String can't use a custom provider
> ------------------------------------------------------
>
>                 Key: CXF-6514
>                 URL: https://issues.apache.org/jira/browse/CXF-6514
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Romain Manni-Bucau
>            Assignee: Sergey Beryozkin
>
> Seems sorting of providers in ServerProviderFactory is done in a way you cant override
the provider used for String type even using a custom @Produces type cause StringTextProvider
si always selected.



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

Mime
View raw message