On 14/10/14 14:04, Vjacheslav V. Borisov wrote:
2014-10-14 14:37 GMT+04:00 Sergey Beryozkin <[email protected]>:
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
May be annotation javax.enterprise.context.RequestScoped suits ?
This anotation adds Netbeans when I create Restfl service from Patterns
This is an extra dependency; to be honest I doubt we can have both the
auto-discovery and the scope control mechanism supported at the same
time. It does not seem to be a good idea now to me to have a new
annotation added, I was wrong, when it is Spring the lifecycle control
has to be done via Spring ApplicationContext...
Perhaps you should experiment with a pure Spring based auto-discovery
mechanism, where Spring @Component and @Scope annotations are used...
Cheers, Sergey