cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <sbery...@progress.com>
Subject Re: Whiteboard pattern for JAX-RS services
Date Thu, 25 Jun 2009 15:46:13 GMT
Hi Josh


>> I'd like to ask your opinion about providing JAXRS providers through this
>> pattern.
<snip/>
>>

> I'm not sure how CXF keeps track of these providers now, but I assume
> there's a registry of some kind.  Are the providers tied to specific jax-rs
> resources, or are they "global"?  If it's a global registry, it should be
> trivial to add a service tracker that watches for new services that are
> registered with the osgi container under the MessageBodyReader,
> MessageBodyWriter, or ExceptionMapper interfaces.  The service tracker would
> add or remove the providers from the internal CXF provider registry.  That's
> what I did with the resteasy spi, but I am not as familiar with how CXF
> keeps track of providers.

CXF JAX-RS has a global registry which provides providers supporting formats/features as requested
by the spec (for ex JAXB support, 
etc). These providers are shared. In addition, every endpoint gets the opportunity to register
per-endpoint unique providers. Some 
endpoints may or may not share the same instances but it's up to the app developer. So say
the same JAXB provider may be configured 
to suit a particular endpoint's needs

Thus, given that the endpoint or client is created by DOSGI, I was thinking about the user
bundles providing a list of additional 
providers using a service property :

Dictionary props = ...
props.put("org.apache.cxf.rs.providers", new Object[]{provider1, provider2});

and then publish or attempt to bind...

and DOSGI will use them at the point of creating the endpoint/client

I'm wondering, would this approach work for you ?

>
> Oh, and sorry to hijack the thread, but I've been using the jax-rs frontend
> for DOSGi and I'm very happy with it... thanks for all of your work in this
> area.  Job well done!

thanks a million for experimenting and providing the feedback

cheers, Sergey

>
> Thanks,
> Josh
> 


Mime
View raw message