[cdi-dev] [JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT

Matěj Novotný (Jira) issues at jboss.org
Tue Jun 9 07:55:06 EDT 2020


    [ https://issues.redhat.com/browse/CDI-746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146021#comment-14146021 ] 

Matěj Novotný commented on CDI-746:
-----------------------------------

{quote} if a PBA is veto there is no injection point for it so it shouldn't be fired
{quote}
In accordance to current spec wording, PIP should be fired as it precedes PBA. So the injection point exists at the time you fire the event. The actual takeaway is that you should be aware of the ordering.

Ok, I see what you meant by orphaned.

So firstly, you are saying that (1) is broken - but you automatically consider that you perform (1) when you also perform (2) (which you yourself discarded as "never seen" in the first place). Those two use cases can exist on their own and work perfectly well.

Secondly, I don't see how (1) would be broken even if you performed both, (1) and (2) within single application. Say you monitor PIP to detect an injection of {{Foo}} and you know there is no such bean and want to register an additional bean of that type if you detect usage. Fine, you can still do that. The fact that. There is exactly "n" cases where {{Foo}} is injected, in this case n > 0. Then you have vetoing - you can decide to veto "m" types, where {{m <= n}}; in other words, legit injection points may remain even after some vetoing.

The only edge case would be if you {{m == n}} and you veto all occurrences. But even in such a case you end up registering {{Foo}} that just never gets created if it's not needed.

> PBA should be fired just after PAT and not after PIP or PIT
> -----------------------------------------------------------
>
>                 Key: CDI-746
>                 URL: https://issues.redhat.com/browse/CDI-746
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Portable Extensions
>    Affects Versions: 2.0.SP1
>            Reporter: Romain Manni-Bucau
>            Priority: Major
>
> Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
> Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
> Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the cdi-dev mailing list