[cdi-dev] [JBoss JIRA] (CDI-633) Intoroduce BeanManager.event()

Sven Linstaedt (JIRA) issues at jboss.org
Mon Oct 10 04:39:00 EDT 2016


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

Sven Linstaedt edited comment on CDI-633 at 10/10/16 4:38 AM:
--------------------------------------------------------------

[~manovotn] Not completely: {{javax.enterprise.event.Event<T>}} is meant for application driven event triggering. In order to narrow down the event type, you can either specify a {{java.lang.Class<T>}} or a for generics a {{javax.enterprise.util.TypeLiteral<U>}}.

As an extension developer, {{Event<T>}} is not sufficient as you can neither 
# resolve {{Event<T>}} before {{AfterDeploymentValidation}} nor
# narrow down the event type by an extension-resolved {{java.lang.reflect.Type}}, which can not be hardcoded using {{TypeLiteral<U>}} as the static type is not known to the extension and TypeLiteral was not meant for being created out of some unknown {{Type}}.

So there is still a need for extending the existing method {{BeanManager#fire}} and of course keeping it backwards compatible as mentioned in CDI-493.



was (Author: tzwoenn):
[~manovotn] Not completely: {{javax.enterprise.event.Event<T>}} is meant for application driven event triggering. In order to narrow down the event type, you can either specify a {{java.lang.Class<T>}} or a for generics a {{javax.enterprise.util.TypeLiteral<U>}}.

As an extension developer, {{Event<T>}} is not sufficient as you can neither 
# resolve {{Event<T>}} before{{AfterDeploymentValidation}} nor
# narrow down the event type by an extension-resolved {{java.lang.reflect.Type}}, which can not be hardcoded using {{TypeLiteral<U>}} as the static type is not known to the extension and TypeLiteral was not meant for being created out of some unknown {{Type}}.

So there is still a need for extending the existing method {{BeanManager#fire}} and of course keeping it backwards compatible as mentioned in CDI-493.


> Intoroduce BeanManager.event()
> ------------------------------
>
>                 Key: CDI-633
>                 URL: https://issues.jboss.org/browse/CDI-633
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Martin Kouba
>             Fix For: 2.0 .Final
>
>
> * this would allow to define the _specified type_ - the container may use the specified type to infer the parameterized type of the event types
> * the method should return {{javax.enterprise.event.Event<Object>}} with no qualifiers



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


More information about the cdi-dev mailing list