Hi On Thu, Oct 14, 2010 at 5:32 PM, KARR, DAVID (ATTSI) <[email protected]> wrote:
> I'm getting back to using CXF again. I looked at the previous > application I implemented with it, and I noticed that I defined my > service bean with prototype scope. This seemed odd, as there didn't > appear to be anything in the controller that obviously required that. > Is there something non-obvious that makes service beans work (or work > better) with prototype scope? > personally I prefer singletons but sometimes users like dealing with prototypes because it makes it easier for them to deal with synchronization issues. By the way, it is likely the prototype scope was ignored by CXF. Probably starting from 2.2.9 prototypes are properly supported in that lifecycle methods such as init and destroy will also be called (at the moment only if @PostCreate and @PreDestroy annotations are used), please see : http://cxf.apache.org/docs/jax-rs.html#JAX-RS-Resourcelifecycles and http://cxf.apache.org/docs/jax-rs.html#JAX-RS-Lifecyclemanagement cheers, Sergey
