On 14/10/14 06:22, Vjacheslav V. Borisov wrote:
2014-10-13 18:10 GMT+04:00 Sergey Beryozkin <[email protected]>:
How to setup singleton / per request resources in case of
https://cxf.apache.org/docs/jaxrs-services-configuration.html#
JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders
It currently works only with Spring. Not possible yet to auto-discover
the root resources/providers if no Spring is used...
But I am using spring with auto-discover feature. I just dont know how to
conigure resources to "per request" (they are singletons by default)
I'm not sure the auto-discovery can work well with the Spring mechanism
of dealing with non-singleton contexts. In Spring one has to declare
scopes like "prototype", etc, see
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-FromSpring
i.e, the bean classes have to be declared which leaves no space for the
auto-discovery.
May be an annotation such as @PerRequest can be added which will take
effect only during the auto-discovery phase. I'll think about it
Cheers, Sergey