[cdi-dev] [JBoss JIRA] (CDI-114) Allow registration of beans at runtime
Romain Manni-Bucau (JIRA)
issues at jboss.org
Mon Feb 20 04:11:00 EST 2017
[ https://issues.jboss.org/browse/CDI-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13365909#comment-13365909 ]
Romain Manni-Bucau commented on CDI-114:
----------------------------------------
If you know the type you can surely sort it out with producers but producers generally means 'do it yourself' which would lead to keeping the component manager more or less. However an extension can produce any bean based on a qualifier (see https://gist.github.com/antoinesd/3097661ca99fa61900fb but instead of Object you can use the xwiki-api/interfaces). Issue allowing runtime registration is you would need to reboot the container more or less bypassing the scanning only to validate injection points and to reinject all created beans to ensure the consistency. It is a lot of work and overhead at runtime for not that much gain since a manager is easy and fast for this kind of dynamic registration - even with subclassloaders. Hope this makes some sense
> 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 was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the cdi-dev
mailing list