[DOSGi] Support for org.apache.cxf.jaxrs.ext.ContextProvider

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[DOSGi] Support for org.apache.cxf.jaxrs.ext.ContextProvider

Ivo Leitão
I've created a JIRA https://issues.apache.org/jira/browse/DOSGI-266 to request support for org.apache.cxf.jaxrs.ext.ContextProvider. I'm trying CXF search support in OSGi and the object (SearchContext) is not injected (it's always null)

I've noticed that in the documentation it's mentioned that

"Additionally, starting from CXF 2.6.0, SearchContextProvider needs to be registered as jaxrs:provider."

I think that there is currently no support for this in DOSGi. As mentioned in the JIRA only ExceptionMapper, MessageBodyReader, MessageBodyWriter and ContextResolver are supported.

I'm not completely sure but I think I can do it with a Feature. Anyone with experience with Search.

Best Regards,
Ivo Leitão
Reply | Threaded
Open this post in threaded view
|

Re: [DOSGi] Support for org.apache.cxf.jaxrs.ext.ContextProvider

cschneider
I am not experienced with search support.
Can you create a very small example at github or point me to an existing
example.

For the fix in DOSGi have you tried to add ContextProvider to the
isProvider(Object intent) method?
Does it then work for you ?

Christian

On 08.05.2017 16:18, Ivo Leitão wrote:

> I've created a JIRA https://issues.apache.org/jira/browse/DOSGI-266 to
> request support for org.apache.cxf.jaxrs.ext.ContextProvider. I'm trying CXF
> search support in OSGi and the object (SearchContext) is not injected (it's
> always null)
>
> I've noticed that in the documentation it's mentioned that
>
> "Additionally, starting from CXF 2.6.0, SearchContextProvider needs to be
> registered as jaxrs:provider."
>
> I think that there is currently no support for this in DOSGi. As mentioned
> in the JIRA only ExceptionMapper, MessageBodyReader, MessageBodyWriter and
> ContextResolver are supported.
>
> I'm not completely sure but I think I can do it with a Feature. Anyone with
> experience with Search.
>
> Best Regards,
> Ivo Leitão
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGi-Support-for-org-apache-cxf-jaxrs-ext-ContextProvider-tp5780279.html
> Sent from the cxf-user mailing list archive at Nabble.com.


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply | Threaded
Open this post in threaded view
|

Re: [DOSGi] Support for org.apache.cxf.jaxrs.ext.ContextProvider

Sergey Beryozkin
Administrator
Hi Ivo, it was supported in in DOSGi 1.x but at not in 2.0 at the moment...
For now you can have

private SearchContext getSearchContext() {
     return new SearchContextImpl(JAXRSUtils.getCurrentMessage());
}

Hi Cristian, it is documented here:

http://cxf.apache.org/docs/jax-rs-search.html

(and used by some of our colleagues :-))

Sergey
On 08/05/17 15:39, Christian Schneider wrote:

> I am not experienced with search support.
> Can you create a very small example at github or point me to an existing
> example.
>
> For the fix in DOSGi have you tried to add ContextProvider to the
> isProvider(Object intent) method?
> Does it then work for you ?
>
> Christian
>
> On 08.05.2017 16:18, Ivo Leitão wrote:
>> I've created a JIRA https://issues.apache.org/jira/browse/DOSGI-266 to
>> request support for org.apache.cxf.jaxrs.ext.ContextProvider. I'm
>> trying CXF
>> search support in OSGi and the object (SearchContext) is not injected
>> (it's
>> always null)
>>
>> I've noticed that in the documentation it's mentioned that
>>
>> "Additionally, starting from CXF 2.6.0, SearchContextProvider needs to be
>> registered as jaxrs:provider."
>>
>> I think that there is currently no support for this in DOSGi. As
>> mentioned
>> in the JIRA only ExceptionMapper, MessageBodyReader, MessageBodyWriter
>> and
>> ContextResolver are supported.
>>
>> I'm not completely sure but I think I can do it with a Feature. Anyone
>> with
>> experience with Search.
>>
>> Best Regards,
>> Ivo Leitão
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/DOSGi-Support-for-org-apache-cxf-jaxrs-ext-ContextProvider-tp5780279.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/
Reply | Threaded
Open this post in threaded view
|

Re: [DOSGi] Support for org.apache.cxf.jaxrs.ext.ContextProvider

Ivo Leitão
Hello,

Thank you Sergey. From the input that I have received from Christian in the JIRA the solution that I was proposing in there does not work, the SearchContext is null even with that fix (Thank you for the test Christian !).

With the code that you provided I think I can instantiate a SearchContext by hand at least while this issue is not fixed.

Best Regards,
Ivo Leitão