[JBoss JIRA] (CDI-433) AdminEvent example has redundant qualifiers.
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-433?page=com.atlassian.jira.plugin.sy... ]
John Ament updated CDI-433:
---------------------------
Affects Version/s: 1.2.Final
> AdminEvent example has redundant qualifiers.
> --------------------------------------------
>
> Key: CDI-433
> URL: https://issues.jboss.org/browse/CDI-433
> Project: CDI Specification Issues
> Issue Type: Clarification
> Affects Versions: 1.2.Final
> Reporter: John Ament
> Priority: Minor
>
> In the CDI 1.2 spec, the following text appears:
> For example, this injected Event has specified type LoggedInEvent and specified qualifier @Admin:
> {{@Inject @Admin Event<LoggedInEvent> any;}}
> The select() method returns a child Event for a given specified type and additional specified qualifiers. If no specified type is given, the specified type is the same as the parent.
> For example, this child Event has required type AdminLoggedInEvent and additional specified qualifier {{@Admin}}:
> {noformat}
> Event<AdminLoggedInEvent> admin = any.select(
> AdminLoggedInEvent.class,
> new AdminQualifier() );
> {noformat}
> The problem is that the injection point any already is qualified @Admin, so the use is duplicate here. I believe the intention was that the injection point would read
> {{@Inject Event<LoggedInEvent> any;}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (CDI-433) AdminEvent example has redundant qualifiers.
by John Ament (JIRA)
John Ament created CDI-433:
------------------------------
Summary: AdminEvent example has redundant qualifiers.
Key: CDI-433
URL: https://issues.jboss.org/browse/CDI-433
Project: CDI Specification Issues
Issue Type: Clarification
Reporter: John Ament
Priority: Minor
In the CDI 1.2 spec, the following text appears:
For example, this injected Event has specified type LoggedInEvent and specified qualifier @Admin:
{{@Inject @Admin Event<LoggedInEvent> any;}}
The select() method returns a child Event for a given specified type and additional specified qualifiers. If no specified type is given, the specified type is the same as the parent.
For example, this child Event has required type AdminLoggedInEvent and additional specified qualifier {{@Admin}}:
{noformat}
Event<AdminLoggedInEvent> admin = any.select(
AdminLoggedInEvent.class,
new AdminQualifier() );
{noformat}
The problem is that the injection point any already is qualified @Admin, so the use is duplicate here. I believe the intention was that the injection point would read
{{@Inject Event<LoggedInEvent> any;}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
AfterBeanDiscovery in the light of CDI-392
by Martin Kouba
Hi all,
I see an inconsistency between the resolution of CDI-392 and the current
wording of "11.5.3. AfterBeanDiscovery event".
addBean(): "Fires an event of type ProcessBean containing the given Bean
and then registers the Bean with the container, thereby making it
available for injection into other beans. The given Bean may implement
Interceptor or Decorator."
On the other hand BeanManager.getBeans() javadoc:
"Note that when called during invocation of an AfterBeanDiscovery event
observer, this method will only return beans discovered by the container
before the AfterBeanDiscovery event is fired."
It seems ProcessBean should be fired and the bean should be registred
when addBean() is called BUT in the same time it should not be available
via BeanManager.getBeans() until all AfterBeanDiscovery observers are
processed.
The same applies to observer methods.
Weld 2.2.0.Final delays the ProcessBean/registration until all
AfterBeanDiscovery observers are processed (note that it's not backwards
compatible). I believe this is correct. If so, the AfterBeanDiscovery
event description should be clarified. Otherwise the RI must be changed
(and I'm afraid it wouldn't be that trivial).
--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
10 years, 8 months