Hi Pat
On 22/11/11 13:40, Pat Turner wrote:
Hi Sergey,
thanks for replying.
I'd like a way to lookup a sub-resource by Class name, and have it's jax-rs
annotated fields injected.
From reading the Jersey docs, this is exactly what ResourceContext does. Is
there a CXF equivalent?
I don't understand why a subresource locator needs to be looked up using
a class name from the application code, can you post an example please ?
My own understanding is that subresource handlers are just utility
classes which make it possible to keep the root resources simple enough
and not having to do with all the processing.
One tricky issue is that the JAX-RS runtime can not know how the
application code manages the subresources, for example, does it reuse a
single subresource instance across multiple requests or not; if yes then
the injection will be completely thread-unsafe.
Btw, I don't expect this to happen as the jax-rs spec clearly states that
sub-resources are managed by the application. But not having this festure
makes me wonder how I can sensibly make us of sub-resources at all.
Let me know please how are you considering to use them. Subresources can
have everything the root resources have except that
@PathParam/@QueryParam have to be added to methods, not possible to get
them injected as properties and contexts have to be manually injected.
That said, we have a long pending issue to do with supporting injecting
the contexts into subresources - this can be tackled but we need to make
sure it works with multiple threads too
Sergey
Thanks again,
Pat
--
View this message in context:
http://cxf.547215.n5.nabble.com/Injecting-jax-rs-PathParam-into-sub-resource-fields-tp5013364p5013574.html
Sent from the cxf-user mailing list archive at Nabble.com.