You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Barry Fitzgerald (JIRA)" <ji...@apache.org> on 2008/02/07 18:51:09 UTC

[jira] Created: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Enhancement to JAX-RS spring configuration for registering providers
--------------------------------------------------------------------

                 Key: CXF-1425
                 URL: https://issues.apache.org/jira/browse/CXF-1425
             Project: CXF
          Issue Type: Sub-task
          Components: REST
    Affects Versions: 2.1
            Reporter: Barry Fitzgerald
             Fix For: 2.1


Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:

<jaxrs:server id="bookservice"
		        address="/">
    <jaxrs:serviceBeans>
      <ref bean="bookstore"/>
    </jaxrs:serviceBeans>
    <jaxrs:entityProviders>
			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
	</jaxrs:entityProviders>		   
  </jaxrs:server>
  <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
  </bean>

This list will overwrite the default Entity Provider list and will be ordered as usual.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Barry Fitzgerald (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barry Fitzgerald updated CXF-1425:
----------------------------------

    Attachment: CXF-1425.patch

Patch from latest trunk.

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>            Assignee: Jervis Liu
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch, CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Jervis Liu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jervis Liu reassigned CXF-1425:
-------------------------------

    Assignee: Jervis Liu

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>            Assignee: Jervis Liu
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566716#action_12566716 ] 

Sergey Beryozkin commented on CXF-1425:
---------------------------------------

Super. +1.

The only comment is that I would not have the original list overridden. There's a default set of providers a JAX-RS implementation needs to provide thus having to specify all of them would be tricky. 

IMHO, the right behavior would be to have a list of configured providers added to the existing one, with duplicates removed.

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>             Fix For: 2.1
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Barry Fitzgerald (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barry Fitzgerald updated CXF-1425:
----------------------------------

    Attachment: CXF-1425.patch

Patch to add ability to specify custom providers in the spring setup.

Config:

<jaxrs:server id="bookservice"
		        address="/">
    <jaxrs:serviceBeans>
      <ref bean="bookstore"/>
    </jaxrs:serviceBeans>
    <jaxrs:entityProviders>
			<bean class="org.apache.cxf.systest.jaxrs.BadgerFishProvider"/>
	</jaxrs:entityProviders>		   
</jaxrs:server>

This config will add the provider to a list of user defined providers. For an incoming list the user provided list is checked for possible matches. Only if no matches are found are the default entity providers used. See section 3.1.2 of the JAX-RS spec for further details.



> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Barry Fitzgerald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566726#action_12566726 ] 

Barry Fitzgerald commented on CXF-1425:
---------------------------------------

I had a think about this and thought that overriding the current list makes most sense. I think that although a JAX-RS implementation needs to provide all default providers there is no reason a given configuration needs them all. e.g. one use case might never need JSON or XML just some custom provider of MIME type "application/widget"

Secondly it gets awkward removing duplicates - how do you define a duplicate - same type, same ProduceMime (what about overlaps?), same instance?

Ideally I think it would be great if you could in the spring config add providers, remove providers and clear the whole list etc. 

But I think this enhancement will most use cases and is a good start.









> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>             Fix For: 2.1
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Jervis Liu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567394#action_12567394 ] 

Jervis Liu commented on CXF-1425:
---------------------------------

Hi Barry, could you please redo the patch based on the latest trunk? There are a couple of merge conflicts in ProviderFactoryImpl, ProviderFactoryImplTest and Beans.xml and I cant be 100% sure which version to pick up.

Thanks,
Jervis

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>            Assignee: Jervis Liu
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1425.
------------------------------

    Resolution: Fixed
      Assignee: Daniel Kulp  (was: Jervis Liu)

Patch applied (with some minor tweeks)

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>            Assignee: Daniel Kulp
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch, CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1425) Enhancement to JAX-RS spring configuration for registering providers

Posted by "Barry Fitzgerald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568527#action_12568527 ] 

Barry Fitzgerald commented on CXF-1425:
---------------------------------------

Could this be patched?

> Enhancement to JAX-RS spring configuration for registering providers
> --------------------------------------------------------------------
>
>                 Key: CXF-1425
>                 URL: https://issues.apache.org/jira/browse/CXF-1425
>             Project: CXF
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 2.1
>            Reporter: Barry Fitzgerald
>            Assignee: Jervis Liu
>             Fix For: 2.1
>
>         Attachments: CXF-1425.patch, CXF-1425.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Enhancement to allow a list of custom providers be specified for a spring configured JAX-RS server. Syntax as below:
> <jaxrs:server id="bookservice"
> 		        address="/">
>     <jaxrs:serviceBeans>
>       <ref bean="bookstore"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:entityProviders>
> 			<bean class="org.apache.cxf.jaxrs.provider.JAXBElementProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.StringProvider"/>
> 			<bean class="org.apache.cxf.jaxrs.provider.BadgerFishProvider"/>
> 	</jaxrs:entityProviders>		   
>   </jaxrs:server>
>   <bean id="bookstore" scope="prototype" class="org.apache.cxf.systest.jaxrs.BookStore">
>   </bean>
> This list will overwrite the default Entity Provider list and will be ordered as usual.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.