[weld-issues] [JBoss JIRA] Commented: (WELD-491) Warn if CDI annotations are placed on classes that are not managed beans

Nicklas Karlsson (JIRA) jira-events at lists.jboss.org
Fri Apr 16 18:00:25 EDT 2010


    [ https://jira.jboss.org/jira/browse/WELD-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526286#action_12526286 ] 

Nicklas Karlsson commented on WELD-491:
---------------------------------------

Is there something in the spec that says we can't have servlet listeners as managed beans? One could think of usecases when you would like to register servlet listener instances (Servlet 3) that are managed beans (interceptors, alternatives etc).

> Warn if CDI annotations are placed on classes that are not managed beans
> ------------------------------------------------------------------------
>
>                 Key: WELD-491
>                 URL: https://jira.jboss.org/jira/browse/WELD-491
>             Project: Weld
>          Issue Type: Feature Request
>          Components: Bootstrap and Metamodel API
>    Affects Versions: 1.0.1.Final
>            Reporter: Nicklas Karlsson
>            Priority: Minor
>             Fix For: 1.0.2.CR1
>
>
> Warn if CDI annotations are placed on beans that fail the check
>       return !Extension.class.isAssignableFrom(clazz.getJavaClass()) &&
>              !(clazz.isAnonymousClass() || (clazz.isMemberClass() && !clazz.isStatic())) &&
>              !Reflections.isParamerterizedTypeWithWildcard(javaClass) && 
>              !servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(javaClass) && 
>              !servletApiAbstraction.FILTER_CLASS.isAssignableFrom(javaClass) && 
>              !servletApiAbstraction.SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(javaClass) && 
>              !servletApiAbstraction.HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(javaClass) && 
>              !servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(javaClass) && 
>              !ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(javaClass) && 
>              !jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(javaClass) && 
>              (hasSimpleWebBeanConstructor(clazz) || InstantiatorFactory.useInstantiators());
> in AbstractBeanDeployer

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list