[cdi-dev] [JBoss JIRA] (CDI-114) Allow registration of beans at runtime

Mark Struberg (Commented) (JIRA) jira-events at lists.jboss.org
Wed Nov 16 04:38:40 EST 2011

    [ https://issues.jboss.org/browse/CDI-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643254#comment-12643254 ] 

Mark Struberg commented on CDI-114:

Hi Vincent!

Maybe we need to clarify further what we both understand under the term 'dynamic Bean'

What I meant is: dynamically adding Bean<T> metainformation to the container at runtime. E.g. disabling a class or adding a Bean<T> under load which would completely change the behaviour of the container.
I think this is very dangerous.

What will perfectly work already is the following: Have a Bean<T> which gets parsed and scanned on startup and which behaves differently in Contextual<T>#create() depending on the situation and it might even change it's behaviour at runtime (to some degree). 

Currently it will be a bad idea to e.g. change the EL name of a bean at runtime. This will produce crap if the EL-Resolver caches the name-> bean mapping for example. We could introduce a Bean<T>#isDynamic() to prevent the container from applying caching in CDI-1.1.
But a fundamental design decision as of today is that the rules which lead to finding that Bean<T> do not change.

Maybe you could explain what kind of 'dynamics' you have in XWiki?
> Allow registration of beans at runtime
> --------------------------------------
>                 Key: CDI-114
>                 URL: https://issues.jboss.org/browse/CDI-114
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Beans
>    Affects Versions: 1.0
>            Reporter: Vincent Massol
>             Fix For: TBD
> I have use cases where I need to register a bean dynamically at runtime (see the forum reference link for a detailed description of the use case).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list