You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2021/04/11 19:30:43 UTC

[GitHub] [cxf] reta commented on pull request #775: CXF-8344: org.apache.cxf.jaxrs.utils.AnnotationUtils#getNameBindings does not use ClassUnwrapper

reta commented on pull request #775:
URL: https://github.com/apache/cxf/pull/775#issuecomment-817359964


   > ... @ApplicationScoped or @RequestScoped should do he same and properly impl get(bean)) but otherwise looks good
   
   Aha, so thought but here are some findings, in `JAXRSCdiResourceExtension`:
   - we create `PerRequestResourceProvider` when `isCxfSingleton(beanManager, bean)` is `false`
   -  in turn, `isCxfSingleton` checks the scope
       ```
       boolean isCxfSingleton(final BeanManager beanManager, final Bean<?> bean) {
           return beanManager.isNormalScope(bean.getScope()) || isConsideredSingleton(bean.getScope());
       }
       ```
   - and `beanManager.isNormalScope(bean.getScope())` is `true` for all pre-predefined `@XxxScoped` scopes  because each of those has `@NormalScope` annotation as well
   
   So I introduced the custom scope to trigger the `PerRequestResourceProvider`  flow. What do you think, see any issues with `isCxfSingleton` implementation?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org