[cdi-dev] [JBoss JIRA] (CDI-515) Allow to obtain Bean metadata from javax.enterprise.inject.Instance

Antoine Sabot-Durand (JIRA) issues at jboss.org
Wed Feb 3 08:59:00 EST 2016


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

Antoine Sabot-Durand commented on CDI-515:
------------------------------------------

I don't see that limited to instances provided by a given Instance<>. Like you can use Instance.destroy() to destroy any instance today.
A use case could be: obtaining metadata for a bean defined by a class you don't own.
Today we store all bean instances to manage their lifecycle, so how difficult would it be to compare a given instance with these stored instances and retrieving the bean used to generated it. It's probably costly but could be very useful.

> Allow to obtain Bean metadata from javax.enterprise.inject.Instance
> -------------------------------------------------------------------
>
>                 Key: CDI-515
>                 URL: https://issues.jboss.org/browse/CDI-515
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>    Affects Versions: 1.2.Final
>            Reporter: Martin Kouba
>            Assignee: Martin Kouba
>             Fix For: 2.0 (proposed)
>
>
> Sometimes it might be useful to obtain Bean metadata from the {{javax.enterprise.inject.Instance}} (similarly as 5.5.8. Bean metadata). The method could be named {{getBean()}} and should have similar restrictions like {{get()}} (e.g. throw {{UnsatisfiedResolutionException}} if appropriate).



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list