Hi
On 17/11/14 15:12, gquintana wrote:
Hello,

I have a very similar requirement:

I'd like to make ChildResource instance "Spring managed" (at least DI and
optionaly AOP). What's the most efficient way to complete the TODO?

Something like?

> ChildResource child = new ChildResource(id);
> return resourceContext.initResource(child);
Probably the best option, method returning ChildResource can be proxified by Spring ?

Or something like?

> ChildResource child = beanFactory.getBean(ChildResource.class);
> child.setId(id);
> return child;
>

I guess this option works but you have the code being Spring-aware - fine if it suits otherwise the former option would do.

Something even more efficient?
Well I guess if ResourceContext was itself Spring initialized then it would offer one other option for initializing subresources, like
resourceContext.init(ChildResource.class)...

So, probably the 1st option is the least intrusive for now
Sergey

Gérald



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Injecting-JAX-RS-resources-tp5734695p5751216.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to