You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Arne Limburg <ar...@openknowledge.de> on 2021/10/10 10:33:36 UTC

OWB-1393

Hi,

I’ve created OWB-1393 and am going to fix it.

When we find an extension that contains an observer method, that observes an event that is no lifecycle event, we currently fire ProcessObserverMethod during addExtension(…) (before every Extension is registered). That leads to a caching problem. We cache too early (and thus too less entries) and don’t invalidate the cache later.

Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a non-lifecycle event, so we have that bug currently in meecrowave (where I observed it).

That leads me to a few questions:

Is it covered by the spec, that an extension may contain non-lifecycle events?
If not: Should we throw an exception then, which would break CXF and thus Meecrowave.

In any case, how should we handle it?
1. Don’t fire ProcessObserverMethod during extension registration at all?
2. First register every Lifecycle-Event-Observer during extension registration and only then register the non-lifecycle-Observers (which fires the ProcessObserverMethod events)?
3. Invalidate that cache after extension registration (probably the most inperformant way)?

Any opinion?

Cheers,
Arne
OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>


Re: OWB-1393

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Thanks Romain, I'll proceed with a release then

Le mer. 24 nov. 2021 à 08:47, Romain Manni-Bucau <rm...@gmail.com> a
écrit :

> Hi all,
>
> since TomEE is blocked since some weeks due to this issue and I didn't get
> much feedback I went ahead and pushed the proposed patch, feel free to
> review/comment if there is any issue.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le ven. 15 oct. 2021 à 11:27, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Hi Romain,
> >
> > now I understand your point and it sounds valid. I can take a deeper look
> > into it this weekend, but feel free to change it by yourself,  if you
> want.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Montag, 11. Oktober 2021 um 20:51
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > Le lun. 11 oct. 2021 à 20:13, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > Hi Romain,
> > >
> > > The cache in question explicitly caches extensions per lifecycle event,
> > so
> > > a check for isContainerEvent would not helb. We could completely
> disable
> > > that cache, but I’m afraid, that would decrease startup performance
> even
> > > more. I guess, it is good to know, which extension observes
> > > ProcessAnnotatedType events and which doesn’t.
> > >
> >
> > Yes, please don't disable that cache which helps to startup faster when
> > using extensions with several beans.
> > Point was more:
> >
> > for (method: methods) { if (is container) {} }
> > for (method: methods) { if (!is container) {} }
> >
> > versus
> >
> > for (method: filter(methods)) { if (!is container) { } else { define();
> } }
> >
> > Know it is only #extensions x #methods so likely not crazy but sounds
> more
> > natural to prepare the runtime in one pass for this no?
> > Concretely it would be something like
> > https://gist.github.com/rmannibucau/c0e9f4020c01ddb9465cad373ccbe1b6 or
> > https://gist.github.com/rmannibucau/b0cff6375af78d3702b5a2c7b8a6a99c if
> > you
> > want to bypass container event test for "not extension" instances (can
> save
> > a few tests).
> >
> > Concretely your fix ensures that any extension can catch a container
> > lifecycle event issued of another observer definition which is good but
> > keeps the issue that you can still miss event from another extension.
> > Basically it is the same issue between extensions but for normal events.
> >
> > So I think we should just delay
> >
> > GProcessObserverMethod event = new
> > GProcessObserverMethod(webBeansContext, annotatedMethod, observer);
> > webBeansContext.getBeanManagerImpl().fireEvent(event, true,
> > AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
> >
> >
> > to happen after all observers are defined.
> >
> > So overall I'd be to:
> >
> > 0. we keep the cache during the startup ;)
> > 1. keep the observer definition a single loop
> > 2. move the process observer method event firing after all extensions
> > observers definition if possible (means that worse case some vetoed
> > observer will be executed during this time but it is unlikely and we
> can't
> > help that anyway, even replaying the missed observers - because not yet
> > there - once added)
> >
> > Hope it makes more sense phrased this way and it is not too late to
> write a
> > technical mail ;).
> >
> >
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Montag, 11. Oktober 2021 um 08:22
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > +1 looks good.
> > >
> > > out of curiosity: did you think about using isContainerEvent to check
> if
> > > the cache should be setup? wonder if it moves from o(2n) to o(n) the
> > > complexity (but for an extension n is generally not that crazy not
> > > shouldn't change drastically the startup).
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <
> > > https://github.com/rmannibucau><https://github.com/rmannibucau%3e> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > >
> > >
> > >
> > > Le dim. 10 oct. 2021 à 22:12, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > I have pushed a version to the branch OWB-1393.
> > > >
> > > > Feel free to take a look at it. If it looks ok, I can merge it
> > tomorrow.
> > > > With this version we don’t have to touch the cache, simply
> registering
> > > the
> > > > lifecycle observer methods first and only after all lifecycle
> observer
> > > > methods of all extensions are registered, registering the non
> lifecycle
> > > > observer methods of the extensions (which then throws the
> > > > ProcessObserverMethod events and correctly sets up the cache).
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > Datum: Sonntag, 10. Oktober 2021 um 20:04
> > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > Betreff: Re: OWB-1393
> > > > +1, thanks Arne
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > > <http://rmannibucau.wordpress.com> | Github <
> > > > https://github.com/rmannibucau><https://github.com/rmannibucau%3e><
> > https://github.com/rmannibucau%3e%3chttps:/github.com/rmannibucau%3e%3e>
> |
> > > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > > <
> > > >
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > > >
> > > >
> > > >
> > > > Le dim. 10 oct. 2021 à 20:02, Arne Limburg <
> > > arne.limburg@openknowledge.de>
> > > > a écrit :
> > > >
> > > > > Yes, basically that’s my option 2. I am currently implementing it.
> > > > > Feel free to review it, when I have pushed it.
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > >
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > > Betreff: Re: OWB-1393
> > > > > Hmm,
> > > > >
> > > > > Maybe I misread the options (or misinterpreted them) but think we
> > > should:
> > > > >
> > > > > 1. Register all extensions without any fire
> > > > > 2. Start firing events
> > > > >
> > > > > 2. Means we keep the lazy resolution of observers and can
> > destroy/reset
> > > > the
> > > > > cache after afterdeploymentvalidation event.
> > > > >
> > > > >
> > > > > No?
> > > > >
> > > > > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> > > > arne.limburg@openknowledge.de>
> > > > > a écrit :
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > you can fire any Event from extensions and listen to any event in
> > > > > > extensions with every of the three options.
> > > > > > The first option would have the disadvantage that an extension,
> > that
> > > > > > listens to ProcessObserverMethod would not receive the
> > > > > > ProcessObserverMethod event for non-lifecycle observer methods of
> > > other
> > > > > > extensions, which would not be a problem I guess (also I don’t
> know
> > > > what
> > > > > > the spec says about it).
> > > > > >
> > > > > > Imho the second option would be the cleanest. It would basically
> > > mean:
> > > > > > First register every lifecycle event observer of every extension,
> > > then
> > > > > > register every non-lifecycle event of every extension (and fire
> > > > > > ProcessObserverMethod for every of that observer methods). This
> > would
> > > > be
> > > > > > valid, too. But it’s the hardest option to implement with the
> > current
> > > > > code
> > > > > > base.
> > > > > >
> > > > > > The third variant would mean, that ProcessObserverMethod would be
> > > > thrown
> > > > > > again, but not every extension would get every
> > ProcessObserverMethod
> > > > > event
> > > > > > for every non-lifecycle-event of other extensions (which again
> > should
> > > > be
> > > > > no
> > > > > > problem). Or we should disable that cache completely during
> > extension
> > > > > > registration.
> > > > > >
> > > > > > Writing that, I will take a deeper look at variant two or three.
> > > > > >
> > > > > > Cheers,
> > > > > > Arne
> > > > > >
> > > > > > OPEN KNOWLEDGE GmbH
> > > > > > Poststraße 1, 26122 Oldenburg
> > > > > > Mobil: +49 151 - 108 22 942
> > > > > > Tel: +49 441 - 4082-154
> > > > > > Fax: +49 441 - 4082-111
> > > > > > arne.limburg@openknowledge.de<mailto:
> arne.limburg@openknowledge.de
> > >
> > > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > >
> > > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > > >
> > > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > > Zu unseren Events<
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > > >
> > > > > >
> > > > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > > > Betreff: Re: OWB-1393
> > > > > > Hi
> > > > > >
> > > > > > 3 sounds the only valid option since it is valid and used to fire
> > any
> > > > > event
> > > > > > in extensions and is used to communicate between them from time
> to
> > > > time.
> > > > > >
> > > > > > Hope it helps.
> > > > > >
> > > > > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > > > > arne.limburg@openknowledge.de>
> > > > > > a écrit :
> > > > > >
> > > > > > > FYI,
> > > > > > > I now went with solution 1 and pushed it to a branch. If there
> > are
> > > no
> > > > > > > objections, I’ll merge it tomorrow or so.
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Arne
> > > > > > >
> > > > > > > OPEN KNOWLEDGE GmbH
> > > > > > > Poststraße 1, 26122 Oldenburg
> > > > > > > Mobil: +49 151 - 108 22 942
> > > > > > > Tel: +49 441 - 4082-154
> > > > > > > Fax: +49 441 - 4082-111
> > > > > > > arne.limburg@openknowledge.de<mailto:
> > arne.limburg@openknowledge.de
> > > >
> > > > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > > >
> > > > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > > > >
> > > > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > > > Zu unseren Events<
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > > > >
> > > > > > >
> > > > > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > > > > Betreff: OWB-1393
> > > > > > > Hi,
> > > > > > >
> > > > > > > I’ve created OWB-1393 and am going to fix it.
> > > > > > >
> > > > > > > When we find an extension that contains an observer method,
> that
> > > > > observes
> > > > > > > an event that is no lifecycle event, we currently fire
> > > > > > > ProcessObserverMethod during addExtension(…) (before every
> > > Extension
> > > > is
> > > > > > > registered). That leads to a caching problem. We cache too
> early
> > > (and
> > > > > > thus
> > > > > > > too less entries) and don’t invalidate the cache later.
> > > > > > >
> > > > > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > > > > non-lifecycle event, so we have that bug currently in
> meecrowave
> > > > > (where I
> > > > > > > observed it).
> > > > > > >
> > > > > > > That leads me to a few questions:
> > > > > > >
> > > > > > > Is it covered by the spec, that an extension may contain
> > > > non-lifecycle
> > > > > > > events?
> > > > > > > If not: Should we throw an exception then, which would break
> CXF
> > > and
> > > > > thus
> > > > > > > Meecrowave.
> > > > > > >
> > > > > > > In any case, how should we handle it?
> > > > > > > 1. Don’t fire ProcessObserverMethod during extension
> registration
> > > at
> > > > > all?
> > > > > > > 2. First register every Lifecycle-Event-Observer during
> extension
> > > > > > > registration and only then register the non-lifecycle-Observers
> > > > (which
> > > > > > > fires the ProcessObserverMethod events)?
> > > > > > > 3. Invalidate that cache after extension registration (probably
> > the
> > > > > most
> > > > > > > inperformant way)?
> > > > > > >
> > > > > > > Any opinion?
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Arne
> > > > > > > OPEN KNOWLEDGE GmbH
> > > > > > > Poststraße 1, 26122 Oldenburg
> > > > > > > Mobil: +49 151 - 108 22 942
> > > > > > > Tel: +49 441 - 4082-154
> > > > > > > Fax: +49 441 - 4082-111
> > > > > > > arne.limburg@openknowledge.de<mailto:
> > arne.limburg@openknowledge.de
> > > >
> > > > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > > <http://www.openknowledge.de%3chttps:/
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > > >>
> > > > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > > > >
> > > > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > > > Zu unseren Events<
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


-- 
Jean-Louis

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi all,

since TomEE is blocked since some weeks due to this issue and I didn't get
much feedback I went ahead and pushed the proposed patch, feel free to
review/comment if there is any issue.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 15 oct. 2021 à 11:27, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Hi Romain,
>
> now I understand your point and it sounds valid. I can take a deeper look
> into it this weekend, but feel free to change it by yourself,  if you want.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Montag, 11. Oktober 2021 um 20:51
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> Le lun. 11 oct. 2021 à 20:13, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Hi Romain,
> >
> > The cache in question explicitly caches extensions per lifecycle event,
> so
> > a check for isContainerEvent would not helb. We could completely disable
> > that cache, but I’m afraid, that would decrease startup performance even
> > more. I guess, it is good to know, which extension observes
> > ProcessAnnotatedType events and which doesn’t.
> >
>
> Yes, please don't disable that cache which helps to startup faster when
> using extensions with several beans.
> Point was more:
>
> for (method: methods) { if (is container) {} }
> for (method: methods) { if (!is container) {} }
>
> versus
>
> for (method: filter(methods)) { if (!is container) { } else { define(); } }
>
> Know it is only #extensions x #methods so likely not crazy but sounds more
> natural to prepare the runtime in one pass for this no?
> Concretely it would be something like
> https://gist.github.com/rmannibucau/c0e9f4020c01ddb9465cad373ccbe1b6 or
> https://gist.github.com/rmannibucau/b0cff6375af78d3702b5a2c7b8a6a99c if
> you
> want to bypass container event test for "not extension" instances (can save
> a few tests).
>
> Concretely your fix ensures that any extension can catch a container
> lifecycle event issued of another observer definition which is good but
> keeps the issue that you can still miss event from another extension.
> Basically it is the same issue between extensions but for normal events.
>
> So I think we should just delay
>
> GProcessObserverMethod event = new
> GProcessObserverMethod(webBeansContext, annotatedMethod, observer);
> webBeansContext.getBeanManagerImpl().fireEvent(event, true,
> AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
>
>
> to happen after all observers are defined.
>
> So overall I'd be to:
>
> 0. we keep the cache during the startup ;)
> 1. keep the observer definition a single loop
> 2. move the process observer method event firing after all extensions
> observers definition if possible (means that worse case some vetoed
> observer will be executed during this time but it is unlikely and we can't
> help that anyway, even replaying the missed observers - because not yet
> there - once added)
>
> Hope it makes more sense phrased this way and it is not too late to write a
> technical mail ;).
>
>
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Montag, 11. Oktober 2021 um 08:22
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > +1 looks good.
> >
> > out of curiosity: did you think about using isContainerEvent to check if
> > the cache should be setup? wonder if it moves from o(2n) to o(n) the
> > complexity (but for an extension n is generally not that crazy not
> > shouldn't change drastically the startup).
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau><https://github.com/rmannibucau%3e> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
> >
> > Le dim. 10 oct. 2021 à 22:12, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > I have pushed a version to the branch OWB-1393.
> > >
> > > Feel free to take a look at it. If it looks ok, I can merge it
> tomorrow.
> > > With this version we don’t have to touch the cache, simply registering
> > the
> > > lifecycle observer methods first and only after all lifecycle observer
> > > methods of all extensions are registered, registering the non lifecycle
> > > observer methods of the extensions (which then throws the
> > > ProcessObserverMethod events and correctly sets up the cache).
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Sonntag, 10. Oktober 2021 um 20:04
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > +1, thanks Arne
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > <https://rmannibucau.metawerx.net/> | Old Blog
> > > <http://rmannibucau.wordpress.com> | Github <
> > > https://github.com/rmannibucau><https://github.com/rmannibucau%3e><
> https://github.com/rmannibucau%3e%3chttps:/github.com/rmannibucau%3e%3e> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > <
> > >
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > > >
> > >
> > >
> > > Le dim. 10 oct. 2021 à 20:02, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > Yes, basically that’s my option 2. I am currently implementing it.
> > > > Feel free to review it, when I have pushed it.
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > Betreff: Re: OWB-1393
> > > > Hmm,
> > > >
> > > > Maybe I misread the options (or misinterpreted them) but think we
> > should:
> > > >
> > > > 1. Register all extensions without any fire
> > > > 2. Start firing events
> > > >
> > > > 2. Means we keep the lazy resolution of observers and can
> destroy/reset
> > > the
> > > > cache after afterdeploymentvalidation event.
> > > >
> > > >
> > > > No?
> > > >
> > > > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> > > arne.limburg@openknowledge.de>
> > > > a écrit :
> > > >
> > > > > Hi,
> > > > >
> > > > > you can fire any Event from extensions and listen to any event in
> > > > > extensions with every of the three options.
> > > > > The first option would have the disadvantage that an extension,
> that
> > > > > listens to ProcessObserverMethod would not receive the
> > > > > ProcessObserverMethod event for non-lifecycle observer methods of
> > other
> > > > > extensions, which would not be a problem I guess (also I don’t know
> > > what
> > > > > the spec says about it).
> > > > >
> > > > > Imho the second option would be the cleanest. It would basically
> > mean:
> > > > > First register every lifecycle event observer of every extension,
> > then
> > > > > register every non-lifecycle event of every extension (and fire
> > > > > ProcessObserverMethod for every of that observer methods). This
> would
> > > be
> > > > > valid, too. But it’s the hardest option to implement with the
> current
> > > > code
> > > > > base.
> > > > >
> > > > > The third variant would mean, that ProcessObserverMethod would be
> > > thrown
> > > > > again, but not every extension would get every
> ProcessObserverMethod
> > > > event
> > > > > for every non-lifecycle-event of other extensions (which again
> should
> > > be
> > > > no
> > > > > problem). Or we should disable that cache completely during
> extension
> > > > > registration.
> > > > >
> > > > > Writing that, I will take a deeper look at variant two or three.
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > >
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > > Betreff: Re: OWB-1393
> > > > > Hi
> > > > >
> > > > > 3 sounds the only valid option since it is valid and used to fire
> any
> > > > event
> > > > > in extensions and is used to communicate between them from time to
> > > time.
> > > > >
> > > > > Hope it helps.
> > > > >
> > > > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > > > arne.limburg@openknowledge.de>
> > > > > a écrit :
> > > > >
> > > > > > FYI,
> > > > > > I now went with solution 1 and pushed it to a branch. If there
> are
> > no
> > > > > > objections, I’ll merge it tomorrow or so.
> > > > > >
> > > > > > Cheers,
> > > > > > Arne
> > > > > >
> > > > > > OPEN KNOWLEDGE GmbH
> > > > > > Poststraße 1, 26122 Oldenburg
> > > > > > Mobil: +49 151 - 108 22 942
> > > > > > Tel: +49 441 - 4082-154
> > > > > > Fax: +49 441 - 4082-111
> > > > > > arne.limburg@openknowledge.de<mailto:
> arne.limburg@openknowledge.de
> > >
> > > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > >
> > > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > > >
> > > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > > Zu unseren Events<
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > > >
> > > > > >
> > > > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > > > Betreff: OWB-1393
> > > > > > Hi,
> > > > > >
> > > > > > I’ve created OWB-1393 and am going to fix it.
> > > > > >
> > > > > > When we find an extension that contains an observer method, that
> > > > observes
> > > > > > an event that is no lifecycle event, we currently fire
> > > > > > ProcessObserverMethod during addExtension(…) (before every
> > Extension
> > > is
> > > > > > registered). That leads to a caching problem. We cache too early
> > (and
> > > > > thus
> > > > > > too less entries) and don’t invalidate the cache later.
> > > > > >
> > > > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > > > non-lifecycle event, so we have that bug currently in meecrowave
> > > > (where I
> > > > > > observed it).
> > > > > >
> > > > > > That leads me to a few questions:
> > > > > >
> > > > > > Is it covered by the spec, that an extension may contain
> > > non-lifecycle
> > > > > > events?
> > > > > > If not: Should we throw an exception then, which would break CXF
> > and
> > > > thus
> > > > > > Meecrowave.
> > > > > >
> > > > > > In any case, how should we handle it?
> > > > > > 1. Don’t fire ProcessObserverMethod during extension registration
> > at
> > > > all?
> > > > > > 2. First register every Lifecycle-Event-Observer during extension
> > > > > > registration and only then register the non-lifecycle-Observers
> > > (which
> > > > > > fires the ProcessObserverMethod events)?
> > > > > > 3. Invalidate that cache after extension registration (probably
> the
> > > > most
> > > > > > inperformant way)?
> > > > > >
> > > > > > Any opinion?
> > > > > >
> > > > > > Cheers,
> > > > > > Arne
> > > > > > OPEN KNOWLEDGE GmbH
> > > > > > Poststraße 1, 26122 Oldenburg
> > > > > > Mobil: +49 151 - 108 22 942
> > > > > > Tel: +49 441 - 4082-154
> > > > > > Fax: +49 441 - 4082-111
> > > > > > arne.limburg@openknowledge.de<mailto:
> arne.limburg@openknowledge.de
> > >
> > > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > <http://www.openknowledge.de%3chttps:/
> > > > > >
> > > > >
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > > >>
> > > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > > >
> > > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > > Zu unseren Events<
> > > > > >
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
Hi Romain,

now I understand your point and it sounds valid. I can take a deeper look into it this weekend, but feel free to change it by yourself,  if you want.

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Romain Manni-Bucau <rm...@gmail.com>
Datum: Montag, 11. Oktober 2021 um 20:51
An: openwebbeans-dev <de...@openwebbeans.apache.org>
Betreff: Re: OWB-1393
Le lun. 11 oct. 2021 à 20:13, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Hi Romain,
>
> The cache in question explicitly caches extensions per lifecycle event, so
> a check for isContainerEvent would not helb. We could completely disable
> that cache, but I’m afraid, that would decrease startup performance even
> more. I guess, it is good to know, which extension observes
> ProcessAnnotatedType events and which doesn’t.
>

Yes, please don't disable that cache which helps to startup faster when
using extensions with several beans.
Point was more:

for (method: methods) { if (is container) {} }
for (method: methods) { if (!is container) {} }

versus

for (method: filter(methods)) { if (!is container) { } else { define(); } }

Know it is only #extensions x #methods so likely not crazy but sounds more
natural to prepare the runtime in one pass for this no?
Concretely it would be something like
https://gist.github.com/rmannibucau/c0e9f4020c01ddb9465cad373ccbe1b6 or
https://gist.github.com/rmannibucau/b0cff6375af78d3702b5a2c7b8a6a99c if you
want to bypass container event test for "not extension" instances (can save
a few tests).

Concretely your fix ensures that any extension can catch a container
lifecycle event issued of another observer definition which is good but
keeps the issue that you can still miss event from another extension.
Basically it is the same issue between extensions but for normal events.

So I think we should just delay

GProcessObserverMethod event = new
GProcessObserverMethod(webBeansContext, annotatedMethod, observer);
webBeansContext.getBeanManagerImpl().fireEvent(event, true,
AnnotationUtil.EMPTY_ANNOTATION_ARRAY);


to happen after all observers are defined.

So overall I'd be to:

0. we keep the cache during the startup ;)
1. keep the observer definition a single loop
2. move the process observer method event firing after all extensions
observers definition if possible (means that worse case some vetoed
observer will be executed during this time but it is unlikely and we can't
help that anyway, even replaying the missed observers - because not yet
there - once added)

Hope it makes more sense phrased this way and it is not too late to write a
technical mail ;).


>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Montag, 11. Oktober 2021 um 08:22
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> +1 looks good.
>
> out of curiosity: did you think about using isContainerEvent to check if
> the cache should be setup? wonder if it moves from o(2n) to o(n) the
> complexity (but for an extension n is generally not that crazy not
> shouldn't change drastically the startup).
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau><https://github.com/rmannibucau%3e> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le dim. 10 oct. 2021 à 22:12, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > I have pushed a version to the branch OWB-1393.
> >
> > Feel free to take a look at it. If it looks ok, I can merge it tomorrow.
> > With this version we don’t have to touch the cache, simply registering
> the
> > lifecycle observer methods first and only after all lifecycle observer
> > methods of all extensions are registered, registering the non lifecycle
> > observer methods of the extensions (which then throws the
> > ProcessObserverMethod events and correctly sets up the cache).
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 20:04
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > +1, thanks Arne
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau><https://github.com/rmannibucau%3e><https://github.com/rmannibucau%3e%3chttps:/github.com/rmannibucau%3e%3e> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
> >
> > Le dim. 10 oct. 2021 à 20:02, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > Yes, basically that’s my option 2. I am currently implementing it.
> > > Feel free to review it, when I have pushed it.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > Hmm,
> > >
> > > Maybe I misread the options (or misinterpreted them) but think we
> should:
> > >
> > > 1. Register all extensions without any fire
> > > 2. Start firing events
> > >
> > > 2. Means we keep the lazy resolution of observers and can destroy/reset
> > the
> > > cache after afterdeploymentvalidation event.
> > >
> > >
> > > No?
> > >
> > > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > Hi,
> > > >
> > > > you can fire any Event from extensions and listen to any event in
> > > > extensions with every of the three options.
> > > > The first option would have the disadvantage that an extension, that
> > > > listens to ProcessObserverMethod would not receive the
> > > > ProcessObserverMethod event for non-lifecycle observer methods of
> other
> > > > extensions, which would not be a problem I guess (also I don’t know
> > what
> > > > the spec says about it).
> > > >
> > > > Imho the second option would be the cleanest. It would basically
> mean:
> > > > First register every lifecycle event observer of every extension,
> then
> > > > register every non-lifecycle event of every extension (and fire
> > > > ProcessObserverMethod for every of that observer methods). This would
> > be
> > > > valid, too. But it’s the hardest option to implement with the current
> > > code
> > > > base.
> > > >
> > > > The third variant would mean, that ProcessObserverMethod would be
> > thrown
> > > > again, but not every extension would get every ProcessObserverMethod
> > > event
> > > > for every non-lifecycle-event of other extensions (which again should
> > be
> > > no
> > > > problem). Or we should disable that cache completely during extension
> > > > registration.
> > > >
> > > > Writing that, I will take a deeper look at variant two or three.
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > Betreff: Re: OWB-1393
> > > > Hi
> > > >
> > > > 3 sounds the only valid option since it is valid and used to fire any
> > > event
> > > > in extensions and is used to communicate between them from time to
> > time.
> > > >
> > > > Hope it helps.
> > > >
> > > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > > arne.limburg@openknowledge.de>
> > > > a écrit :
> > > >
> > > > > FYI,
> > > > > I now went with solution 1 and pushed it to a branch. If there are
> no
> > > > > objections, I’ll merge it tomorrow or so.
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > >
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > > Betreff: OWB-1393
> > > > > Hi,
> > > > >
> > > > > I’ve created OWB-1393 and am going to fix it.
> > > > >
> > > > > When we find an extension that contains an observer method, that
> > > observes
> > > > > an event that is no lifecycle event, we currently fire
> > > > > ProcessObserverMethod during addExtension(…) (before every
> Extension
> > is
> > > > > registered). That leads to a caching problem. We cache too early
> (and
> > > > thus
> > > > > too less entries) and don’t invalidate the cache later.
> > > > >
> > > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > > non-lifecycle event, so we have that bug currently in meecrowave
> > > (where I
> > > > > observed it).
> > > > >
> > > > > That leads me to a few questions:
> > > > >
> > > > > Is it covered by the spec, that an extension may contain
> > non-lifecycle
> > > > > events?
> > > > > If not: Should we throw an exception then, which would break CXF
> and
> > > thus
> > > > > Meecrowave.
> > > > >
> > > > > In any case, how should we handle it?
> > > > > 1. Don’t fire ProcessObserverMethod during extension registration
> at
> > > all?
> > > > > 2. First register every Lifecycle-Event-Observer during extension
> > > > > registration and only then register the non-lifecycle-Observers
> > (which
> > > > > fires the ProcessObserverMethod events)?
> > > > > 3. Invalidate that cache after extension registration (probably the
> > > most
> > > > > inperformant way)?
> > > > >
> > > > > Any opinion?
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c%3e>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > <http://www.openknowledge.de%3chttps:/
> > > > >
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >>
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le lun. 11 oct. 2021 à 20:13, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Hi Romain,
>
> The cache in question explicitly caches extensions per lifecycle event, so
> a check for isContainerEvent would not helb. We could completely disable
> that cache, but I’m afraid, that would decrease startup performance even
> more. I guess, it is good to know, which extension observes
> ProcessAnnotatedType events and which doesn’t.
>

Yes, please don't disable that cache which helps to startup faster when
using extensions with several beans.
Point was more:

for (method: methods) { if (is container) {} }
for (method: methods) { if (!is container) {} }

versus

for (method: filter(methods)) { if (!is container) { } else { define(); } }

Know it is only #extensions x #methods so likely not crazy but sounds more
natural to prepare the runtime in one pass for this no?
Concretely it would be something like
https://gist.github.com/rmannibucau/c0e9f4020c01ddb9465cad373ccbe1b6 or
https://gist.github.com/rmannibucau/b0cff6375af78d3702b5a2c7b8a6a99c if you
want to bypass container event test for "not extension" instances (can save
a few tests).

Concretely your fix ensures that any extension can catch a container
lifecycle event issued of another observer definition which is good but
keeps the issue that you can still miss event from another extension.
Basically it is the same issue between extensions but for normal events.

So I think we should just delay

GProcessObserverMethod event = new
GProcessObserverMethod(webBeansContext, annotatedMethod, observer);
webBeansContext.getBeanManagerImpl().fireEvent(event, true,
AnnotationUtil.EMPTY_ANNOTATION_ARRAY);


to happen after all observers are defined.

So overall I'd be to:

0. we keep the cache during the startup ;)
1. keep the observer definition a single loop
2. move the process observer method event firing after all extensions
observers definition if possible (means that worse case some vetoed
observer will be executed during this time but it is unlikely and we can't
help that anyway, even replaying the missed observers - because not yet
there - once added)

Hope it makes more sense phrased this way and it is not too late to write a
technical mail ;).


>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Montag, 11. Oktober 2021 um 08:22
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> +1 looks good.
>
> out of curiosity: did you think about using isContainerEvent to check if
> the cache should be setup? wonder if it moves from o(2n) to o(n) the
> complexity (but for an extension n is generally not that crazy not
> shouldn't change drastically the startup).
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le dim. 10 oct. 2021 à 22:12, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > I have pushed a version to the branch OWB-1393.
> >
> > Feel free to take a look at it. If it looks ok, I can merge it tomorrow.
> > With this version we don’t have to touch the cache, simply registering
> the
> > lifecycle observer methods first and only after all lifecycle observer
> > methods of all extensions are registered, registering the non lifecycle
> > observer methods of the extensions (which then throws the
> > ProcessObserverMethod events and correctly sets up the cache).
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 20:04
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > +1, thanks Arne
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau><https://github.com/rmannibucau%3e> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
> >
> > Le dim. 10 oct. 2021 à 20:02, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > Yes, basically that’s my option 2. I am currently implementing it.
> > > Feel free to review it, when I have pushed it.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > Hmm,
> > >
> > > Maybe I misread the options (or misinterpreted them) but think we
> should:
> > >
> > > 1. Register all extensions without any fire
> > > 2. Start firing events
> > >
> > > 2. Means we keep the lazy resolution of observers and can destroy/reset
> > the
> > > cache after afterdeploymentvalidation event.
> > >
> > >
> > > No?
> > >
> > > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > Hi,
> > > >
> > > > you can fire any Event from extensions and listen to any event in
> > > > extensions with every of the three options.
> > > > The first option would have the disadvantage that an extension, that
> > > > listens to ProcessObserverMethod would not receive the
> > > > ProcessObserverMethod event for non-lifecycle observer methods of
> other
> > > > extensions, which would not be a problem I guess (also I don’t know
> > what
> > > > the spec says about it).
> > > >
> > > > Imho the second option would be the cleanest. It would basically
> mean:
> > > > First register every lifecycle event observer of every extension,
> then
> > > > register every non-lifecycle event of every extension (and fire
> > > > ProcessObserverMethod for every of that observer methods). This would
> > be
> > > > valid, too. But it’s the hardest option to implement with the current
> > > code
> > > > base.
> > > >
> > > > The third variant would mean, that ProcessObserverMethod would be
> > thrown
> > > > again, but not every extension would get every ProcessObserverMethod
> > > event
> > > > for every non-lifecycle-event of other extensions (which again should
> > be
> > > no
> > > > problem). Or we should disable that cache completely during extension
> > > > registration.
> > > >
> > > > Writing that, I will take a deeper look at variant two or three.
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > > Betreff: Re: OWB-1393
> > > > Hi
> > > >
> > > > 3 sounds the only valid option since it is valid and used to fire any
> > > event
> > > > in extensions and is used to communicate between them from time to
> > time.
> > > >
> > > > Hope it helps.
> > > >
> > > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > > arne.limburg@openknowledge.de>
> > > > a écrit :
> > > >
> > > > > FYI,
> > > > > I now went with solution 1 and pushed it to a branch. If there are
> no
> > > > > objections, I’ll merge it tomorrow or so.
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > >
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > > Betreff: OWB-1393
> > > > > Hi,
> > > > >
> > > > > I’ve created OWB-1393 and am going to fix it.
> > > > >
> > > > > When we find an extension that contains an observer method, that
> > > observes
> > > > > an event that is no lifecycle event, we currently fire
> > > > > ProcessObserverMethod during addExtension(…) (before every
> Extension
> > is
> > > > > registered). That leads to a caching problem. We cache too early
> (and
> > > > thus
> > > > > too less entries) and don’t invalidate the cache later.
> > > > >
> > > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > > non-lifecycle event, so we have that bug currently in meecrowave
> > > (where I
> > > > > observed it).
> > > > >
> > > > > That leads me to a few questions:
> > > > >
> > > > > Is it covered by the spec, that an extension may contain
> > non-lifecycle
> > > > > events?
> > > > > If not: Should we throw an exception then, which would break CXF
> and
> > > thus
> > > > > Meecrowave.
> > > > >
> > > > > In any case, how should we handle it?
> > > > > 1. Don’t fire ProcessObserverMethod during extension registration
> at
> > > all?
> > > > > 2. First register every Lifecycle-Event-Observer during extension
> > > > > registration and only then register the non-lifecycle-Observers
> > (which
> > > > > fires the ProcessObserverMethod events)?
> > > > > 3. Invalidate that cache after extension registration (probably the
> > > most
> > > > > inperformant way)?
> > > > >
> > > > > Any opinion?
> > > > >
> > > > > Cheers,
> > > > > Arne
> > > > > OPEN KNOWLEDGE GmbH
> > > > > Poststraße 1, 26122 Oldenburg
> > > > > Mobil: +49 151 - 108 22 942
> > > > > Tel: +49 441 - 4082-154
> > > > > Fax: +49 441 - 4082-111
> > > > > arne.limburg@openknowledge.de<mailto:arne.limburg@openknowledge.de
> >
> > > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > <http://www.openknowledge.de%3chttps:/
> > > > >
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > > >>
> > > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > > >
> > > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > > Zu unseren Events<
> > > > >
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > > >
> > > > >
> > > >
> > >
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
Hi Romain,

The cache in question explicitly caches extensions per lifecycle event, so a check for isContainerEvent would not helb. We could completely disable that cache, but I’m afraid, that would decrease startup performance even more. I guess, it is good to know, which extension observes ProcessAnnotatedType events and which doesn’t.

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Romain Manni-Bucau <rm...@gmail.com>
Datum: Montag, 11. Oktober 2021 um 08:22
An: openwebbeans-dev <de...@openwebbeans.apache.org>
Betreff: Re: OWB-1393
+1 looks good.

out of curiosity: did you think about using isContainerEvent to check if
the cache should be setup? wonder if it moves from o(2n) to o(n) the
complexity (but for an extension n is generally not that crazy not
shouldn't change drastically the startup).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 10 oct. 2021 à 22:12, Arne Limburg <ar...@openknowledge.de>
a écrit :

> I have pushed a version to the branch OWB-1393.
>
> Feel free to take a look at it. If it looks ok, I can merge it tomorrow.
> With this version we don’t have to touch the cache, simply registering the
> lifecycle observer methods first and only after all lifecycle observer
> methods of all extensions are registered, registering the non lifecycle
> observer methods of the extensions (which then throws the
> ProcessObserverMethod events and correctly sets up the cache).
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 20:04
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> +1, thanks Arne
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau><https://github.com/rmannibucau%3e> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le dim. 10 oct. 2021 à 20:02, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Yes, basically that’s my option 2. I am currently implementing it.
> > Feel free to review it, when I have pushed it.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > Hmm,
> >
> > Maybe I misread the options (or misinterpreted them) but think we should:
> >
> > 1. Register all extensions without any fire
> > 2. Start firing events
> >
> > 2. Means we keep the lazy resolution of observers and can destroy/reset
> the
> > cache after afterdeploymentvalidation event.
> >
> >
> > No?
> >
> > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > Hi,
> > >
> > > you can fire any Event from extensions and listen to any event in
> > > extensions with every of the three options.
> > > The first option would have the disadvantage that an extension, that
> > > listens to ProcessObserverMethod would not receive the
> > > ProcessObserverMethod event for non-lifecycle observer methods of other
> > > extensions, which would not be a problem I guess (also I don’t know
> what
> > > the spec says about it).
> > >
> > > Imho the second option would be the cleanest. It would basically mean:
> > > First register every lifecycle event observer of every extension, then
> > > register every non-lifecycle event of every extension (and fire
> > > ProcessObserverMethod for every of that observer methods). This would
> be
> > > valid, too. But it’s the hardest option to implement with the current
> > code
> > > base.
> > >
> > > The third variant would mean, that ProcessObserverMethod would be
> thrown
> > > again, but not every extension would get every ProcessObserverMethod
> > event
> > > for every non-lifecycle-event of other extensions (which again should
> be
> > no
> > > problem). Or we should disable that cache completely during extension
> > > registration.
> > >
> > > Writing that, I will take a deeper look at variant two or three.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > Hi
> > >
> > > 3 sounds the only valid option since it is valid and used to fire any
> > event
> > > in extensions and is used to communicate between them from time to
> time.
> > >
> > > Hope it helps.
> > >
> > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > FYI,
> > > > I now went with solution 1 and pushed it to a branch. If there are no
> > > > objections, I’ll merge it tomorrow or so.
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > Betreff: OWB-1393
> > > > Hi,
> > > >
> > > > I’ve created OWB-1393 and am going to fix it.
> > > >
> > > > When we find an extension that contains an observer method, that
> > observes
> > > > an event that is no lifecycle event, we currently fire
> > > > ProcessObserverMethod during addExtension(…) (before every Extension
> is
> > > > registered). That leads to a caching problem. We cache too early (and
> > > thus
> > > > too less entries) and don’t invalidate the cache later.
> > > >
> > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > non-lifecycle event, so we have that bug currently in meecrowave
> > (where I
> > > > observed it).
> > > >
> > > > That leads me to a few questions:
> > > >
> > > > Is it covered by the spec, that an extension may contain
> non-lifecycle
> > > > events?
> > > > If not: Should we throw an exception then, which would break CXF and
> > thus
> > > > Meecrowave.
> > > >
> > > > In any case, how should we handle it?
> > > > 1. Don’t fire ProcessObserverMethod during extension registration at
> > all?
> > > > 2. First register every Lifecycle-Event-Observer during extension
> > > > registration and only then register the non-lifecycle-Observers
> (which
> > > > fires the ProcessObserverMethod events)?
> > > > 3. Invalidate that cache after extension registration (probably the
> > most
> > > > inperformant way)?
> > > >
> > > > Any opinion?
> > > >
> > > > Cheers,
> > > > Arne
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c%3e>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>><http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3e%3e>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > <http://www.openknowledge.de%3chttps:/
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >>
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > >
> >
>

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
+1 looks good.

out of curiosity: did you think about using isContainerEvent to check if
the cache should be setup? wonder if it moves from o(2n) to o(n) the
complexity (but for an extension n is generally not that crazy not
shouldn't change drastically the startup).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 10 oct. 2021 à 22:12, Arne Limburg <ar...@openknowledge.de>
a écrit :

> I have pushed a version to the branch OWB-1393.
>
> Feel free to take a look at it. If it looks ok, I can merge it tomorrow.
> With this version we don’t have to touch the cache, simply registering the
> lifecycle observer methods first and only after all lifecycle observer
> methods of all extensions are registered, registering the non lifecycle
> observer methods of the extensions (which then throws the
> ProcessObserverMethod events and correctly sets up the cache).
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 20:04
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> +1, thanks Arne
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le dim. 10 oct. 2021 à 20:02, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Yes, basically that’s my option 2. I am currently implementing it.
> > Feel free to review it, when I have pushed it.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 18:32
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > Hmm,
> >
> > Maybe I misread the options (or misinterpreted them) but think we should:
> >
> > 1. Register all extensions without any fire
> > 2. Start firing events
> >
> > 2. Means we keep the lazy resolution of observers and can destroy/reset
> the
> > cache after afterdeploymentvalidation event.
> >
> >
> > No?
> >
> > Le dim. 10 oct. 2021 à 18:03, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > Hi,
> > >
> > > you can fire any Event from extensions and listen to any event in
> > > extensions with every of the three options.
> > > The first option would have the disadvantage that an extension, that
> > > listens to ProcessObserverMethod would not receive the
> > > ProcessObserverMethod event for non-lifecycle observer methods of other
> > > extensions, which would not be a problem I guess (also I don’t know
> what
> > > the spec says about it).
> > >
> > > Imho the second option would be the cleanest. It would basically mean:
> > > First register every lifecycle event observer of every extension, then
> > > register every non-lifecycle event of every extension (and fire
> > > ProcessObserverMethod for every of that observer methods). This would
> be
> > > valid, too. But it’s the hardest option to implement with the current
> > code
> > > base.
> > >
> > > The third variant would mean, that ProcessObserverMethod would be
> thrown
> > > again, but not every extension would get every ProcessObserverMethod
> > event
> > > for every non-lifecycle-event of other extensions (which again should
> be
> > no
> > > problem). Or we should disable that cache completely during extension
> > > registration.
> > >
> > > Writing that, I will take a deeper look at variant two or three.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Romain Manni-Bucau <rm...@gmail.com>
> > > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > > Betreff: Re: OWB-1393
> > > Hi
> > >
> > > 3 sounds the only valid option since it is valid and used to fire any
> > event
> > > in extensions and is used to communicate between them from time to
> time.
> > >
> > > Hope it helps.
> > >
> > > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> > arne.limburg@openknowledge.de>
> > > a écrit :
> > >
> > > > FYI,
> > > > I now went with solution 1 and pushed it to a branch. If there are no
> > > > objections, I’ll merge it tomorrow or so.
> > > >
> > > > Cheers,
> > > > Arne
> > > >
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > > > Von: Arne Limburg <ar...@openknowledge.de>
> > > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > > Betreff: OWB-1393
> > > > Hi,
> > > >
> > > > I’ve created OWB-1393 and am going to fix it.
> > > >
> > > > When we find an extension that contains an observer method, that
> > observes
> > > > an event that is no lifecycle event, we currently fire
> > > > ProcessObserverMethod during addExtension(…) (before every Extension
> is
> > > > registered). That leads to a caching problem. We cache too early (and
> > > thus
> > > > too less entries) and don’t invalidate the cache later.
> > > >
> > > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > > non-lifecycle event, so we have that bug currently in meecrowave
> > (where I
> > > > observed it).
> > > >
> > > > That leads me to a few questions:
> > > >
> > > > Is it covered by the spec, that an extension may contain
> non-lifecycle
> > > > events?
> > > > If not: Should we throw an exception then, which would break CXF and
> > thus
> > > > Meecrowave.
> > > >
> > > > In any case, how should we handle it?
> > > > 1. Don’t fire ProcessObserverMethod during extension registration at
> > all?
> > > > 2. First register every Lifecycle-Event-Observer during extension
> > > > registration and only then register the non-lifecycle-Observers
> (which
> > > > fires the ProcessObserverMethod events)?
> > > > 3. Invalidate that cache after extension registration (probably the
> > most
> > > > inperformant way)?
> > > >
> > > > Any opinion?
> > > >
> > > > Cheers,
> > > > Arne
> > > > OPEN KNOWLEDGE GmbH
> > > > Poststraße 1, 26122 Oldenburg
> > > > Mobil: +49 151 - 108 22 942
> > > > Tel: +49 441 - 4082-154
> > > > Fax: +49 441 - 4082-111
> > > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > > www.openknowledge.de<<http://www.openknowledge.de%3c<<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> > http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > <http://www.openknowledge.de%3chttps:/
> > > >
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > > >>
> > > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > > >
> > > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > > Zu unseren Events<
> > > >
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > > >
> > > >
> > >
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
I have pushed a version to the branch OWB-1393.

Feel free to take a look at it. If it looks ok, I can merge it tomorrow.
With this version we don’t have to touch the cache, simply registering the lifecycle observer methods first and only after all lifecycle observer methods of all extensions are registered, registering the non lifecycle observer methods of the extensions (which then throws the ProcessObserverMethod events and correctly sets up the cache).

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Romain Manni-Bucau <rm...@gmail.com>
Datum: Sonntag, 10. Oktober 2021 um 20:04
An: openwebbeans-dev <de...@openwebbeans.apache.org>
Betreff: Re: OWB-1393
+1, thanks Arne

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 10 oct. 2021 à 20:02, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Yes, basically that’s my option 2. I am currently implementing it.
> Feel free to review it, when I have pushed it.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 18:32
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> Hmm,
>
> Maybe I misread the options (or misinterpreted them) but think we should:
>
> 1. Register all extensions without any fire
> 2. Start firing events
>
> 2. Means we keep the lazy resolution of observers and can destroy/reset the
> cache after afterdeploymentvalidation event.
>
>
> No?
>
> Le dim. 10 oct. 2021 à 18:03, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Hi,
> >
> > you can fire any Event from extensions and listen to any event in
> > extensions with every of the three options.
> > The first option would have the disadvantage that an extension, that
> > listens to ProcessObserverMethod would not receive the
> > ProcessObserverMethod event for non-lifecycle observer methods of other
> > extensions, which would not be a problem I guess (also I don’t know what
> > the spec says about it).
> >
> > Imho the second option would be the cleanest. It would basically mean:
> > First register every lifecycle event observer of every extension, then
> > register every non-lifecycle event of every extension (and fire
> > ProcessObserverMethod for every of that observer methods). This would be
> > valid, too. But it’s the hardest option to implement with the current
> code
> > base.
> >
> > The third variant would mean, that ProcessObserverMethod would be thrown
> > again, but not every extension would get every ProcessObserverMethod
> event
> > for every non-lifecycle-event of other extensions (which again should be
> no
> > problem). Or we should disable that cache completely during extension
> > registration.
> >
> > Writing that, I will take a deeper look at variant two or three.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > Hi
> >
> > 3 sounds the only valid option since it is valid and used to fire any
> event
> > in extensions and is used to communicate between them from time to time.
> >
> > Hope it helps.
> >
> > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > FYI,
> > > I now went with solution 1 and pushed it to a branch. If there are no
> > > objections, I’ll merge it tomorrow or so.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Arne Limburg <ar...@openknowledge.de>
> > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > Betreff: OWB-1393
> > > Hi,
> > >
> > > I’ve created OWB-1393 and am going to fix it.
> > >
> > > When we find an extension that contains an observer method, that
> observes
> > > an event that is no lifecycle event, we currently fire
> > > ProcessObserverMethod during addExtension(…) (before every Extension is
> > > registered). That leads to a caching problem. We cache too early (and
> > thus
> > > too less entries) and don’t invalidate the cache later.
> > >
> > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > non-lifecycle event, so we have that bug currently in meecrowave
> (where I
> > > observed it).
> > >
> > > That leads me to a few questions:
> > >
> > > Is it covered by the spec, that an extension may contain non-lifecycle
> > > events?
> > > If not: Should we throw an exception then, which would break CXF and
> thus
> > > Meecrowave.
> > >
> > > In any case, how should we handle it?
> > > 1. Don’t fire ProcessObserverMethod during extension registration at
> all?
> > > 2. First register every Lifecycle-Event-Observer during extension
> > > registration and only then register the non-lifecycle-Observers (which
> > > fires the ProcessObserverMethod events)?
> > > 3. Invalidate that cache after extension registration (probably the
> most
> > > inperformant way)?
> > >
> > > Any opinion?
> > >
> > > Cheers,
> > > Arne
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c%3c>
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > <http://www.openknowledge.de%3chttps:/
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >>
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> >
>

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
+1, thanks Arne

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 10 oct. 2021 à 20:02, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Yes, basically that’s my option 2. I am currently implementing it.
> Feel free to review it, when I have pushed it.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 18:32
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> Hmm,
>
> Maybe I misread the options (or misinterpreted them) but think we should:
>
> 1. Register all extensions without any fire
> 2. Start firing events
>
> 2. Means we keep the lazy resolution of observers and can destroy/reset the
> cache after afterdeploymentvalidation event.
>
>
> No?
>
> Le dim. 10 oct. 2021 à 18:03, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > Hi,
> >
> > you can fire any Event from extensions and listen to any event in
> > extensions with every of the three options.
> > The first option would have the disadvantage that an extension, that
> > listens to ProcessObserverMethod would not receive the
> > ProcessObserverMethod event for non-lifecycle observer methods of other
> > extensions, which would not be a problem I guess (also I don’t know what
> > the spec says about it).
> >
> > Imho the second option would be the cleanest. It would basically mean:
> > First register every lifecycle event observer of every extension, then
> > register every non-lifecycle event of every extension (and fire
> > ProcessObserverMethod for every of that observer methods). This would be
> > valid, too. But it’s the hardest option to implement with the current
> code
> > base.
> >
> > The third variant would mean, that ProcessObserverMethod would be thrown
> > again, but not every extension would get every ProcessObserverMethod
> event
> > for every non-lifecycle-event of other extensions (which again should be
> no
> > problem). Or we should disable that cache completely during extension
> > registration.
> >
> > Writing that, I will take a deeper look at variant two or three.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Romain Manni-Bucau <rm...@gmail.com>
> > Datum: Sonntag, 10. Oktober 2021 um 17:39
> > An: openwebbeans-dev <de...@openwebbeans.apache.org>
> > Betreff: Re: OWB-1393
> > Hi
> >
> > 3 sounds the only valid option since it is valid and used to fire any
> event
> > in extensions and is used to communicate between them from time to time.
> >
> > Hope it helps.
> >
> > Le dim. 10 oct. 2021 à 13:57, Arne Limburg <
> arne.limburg@openknowledge.de>
> > a écrit :
> >
> > > FYI,
> > > I now went with solution 1 and pushed it to a branch. If there are no
> > > objections, I’ll merge it tomorrow or so.
> > >
> > > Cheers,
> > > Arne
> > >
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> > > Von: Arne Limburg <ar...@openknowledge.de>
> > > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > > Betreff: OWB-1393
> > > Hi,
> > >
> > > I’ve created OWB-1393 and am going to fix it.
> > >
> > > When we find an extension that contains an observer method, that
> observes
> > > an event that is no lifecycle event, we currently fire
> > > ProcessObserverMethod during addExtension(…) (before every Extension is
> > > registered). That leads to a caching problem. We cache too early (and
> > thus
> > > too less entries) and don’t invalidate the cache later.
> > >
> > > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > > non-lifecycle event, so we have that bug currently in meecrowave
> (where I
> > > observed it).
> > >
> > > That leads me to a few questions:
> > >
> > > Is it covered by the spec, that an extension may contain non-lifecycle
> > > events?
> > > If not: Should we throw an exception then, which would break CXF and
> thus
> > > Meecrowave.
> > >
> > > In any case, how should we handle it?
> > > 1. Don’t fire ProcessObserverMethod during extension registration at
> all?
> > > 2. First register every Lifecycle-Event-Observer during extension
> > > registration and only then register the non-lifecycle-Observers (which
> > > fires the ProcessObserverMethod events)?
> > > 3. Invalidate that cache after extension registration (probably the
> most
> > > inperformant way)?
> > >
> > > Any opinion?
> > >
> > > Cheers,
> > > Arne
> > > OPEN KNOWLEDGE GmbH
> > > Poststraße 1, 26122 Oldenburg
> > > Mobil: +49 151 - 108 22 942
> > > Tel: +49 441 - 4082-154
> > > Fax: +49 441 - 4082-111
> > > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > > www.openknowledge.de<<http://www.openknowledge.de%3c<
> http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > <http://www.openknowledge.de%3chttps:/
> > >
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > > >>
> > > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > > Geschäftsführer: Lars Röwekamp, Jens Schumann
> > >
> > > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > > Zu unseren Events<
> > >
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > > >
> > >
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
Yes, basically that’s my option 2. I am currently implementing it.
Feel free to review it, when I have pushed it.

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Romain Manni-Bucau <rm...@gmail.com>
Datum: Sonntag, 10. Oktober 2021 um 18:32
An: openwebbeans-dev <de...@openwebbeans.apache.org>
Betreff: Re: OWB-1393
Hmm,

Maybe I misread the options (or misinterpreted them) but think we should:

1. Register all extensions without any fire
2. Start firing events

2. Means we keep the lazy resolution of observers and can destroy/reset the
cache after afterdeploymentvalidation event.


No?

Le dim. 10 oct. 2021 à 18:03, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Hi,
>
> you can fire any Event from extensions and listen to any event in
> extensions with every of the three options.
> The first option would have the disadvantage that an extension, that
> listens to ProcessObserverMethod would not receive the
> ProcessObserverMethod event for non-lifecycle observer methods of other
> extensions, which would not be a problem I guess (also I don’t know what
> the spec says about it).
>
> Imho the second option would be the cleanest. It would basically mean:
> First register every lifecycle event observer of every extension, then
> register every non-lifecycle event of every extension (and fire
> ProcessObserverMethod for every of that observer methods). This would be
> valid, too. But it’s the hardest option to implement with the current code
> base.
>
> The third variant would mean, that ProcessObserverMethod would be thrown
> again, but not every extension would get every ProcessObserverMethod event
> for every non-lifecycle-event of other extensions (which again should be no
> problem). Or we should disable that cache completely during extension
> registration.
>
> Writing that, I will take a deeper look at variant two or three.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 17:39
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> Hi
>
> 3 sounds the only valid option since it is valid and used to fire any event
> in extensions and is used to communicate between them from time to time.
>
> Hope it helps.
>
> Le dim. 10 oct. 2021 à 13:57, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > FYI,
> > I now went with solution 1 and pushed it to a branch. If there are no
> > objections, I’ll merge it tomorrow or so.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Arne Limburg <ar...@openknowledge.de>
> > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > Betreff: OWB-1393
> > Hi,
> >
> > I’ve created OWB-1393 and am going to fix it.
> >
> > When we find an extension that contains an observer method, that observes
> > an event that is no lifecycle event, we currently fire
> > ProcessObserverMethod during addExtension(…) (before every Extension is
> > registered). That leads to a caching problem. We cache too early (and
> thus
> > too less entries) and don’t invalidate the cache later.
> >
> > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > non-lifecycle event, so we have that bug currently in meecrowave (where I
> > observed it).
> >
> > That leads me to a few questions:
> >
> > Is it covered by the spec, that an extension may contain non-lifecycle
> > events?
> > If not: Should we throw an exception then, which would break CXF and thus
> > Meecrowave.
> >
> > In any case, how should we handle it?
> > 1. Don’t fire ProcessObserverMethod during extension registration at all?
> > 2. First register every Lifecycle-Event-Observer during extension
> > registration and only then register the non-lifecycle-Observers (which
> > fires the ProcessObserverMethod events)?
> > 3. Invalidate that cache after extension registration (probably the most
> > inperformant way)?
> >
> > Any opinion?
> >
> > Cheers,
> > Arne
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c<http://www.openknowledge.de%3c%3chttp:/www.openknowledge.de%3c>>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > <http://www.openknowledge.de%3chttps:/
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >>
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
>

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm,

Maybe I misread the options (or misinterpreted them) but think we should:

1. Register all extensions without any fire
2. Start firing events

2. Means we keep the lazy resolution of observers and can destroy/reset the
cache after afterdeploymentvalidation event.


No?

Le dim. 10 oct. 2021 à 18:03, Arne Limburg <ar...@openknowledge.de>
a écrit :

> Hi,
>
> you can fire any Event from extensions and listen to any event in
> extensions with every of the three options.
> The first option would have the disadvantage that an extension, that
> listens to ProcessObserverMethod would not receive the
> ProcessObserverMethod event for non-lifecycle observer methods of other
> extensions, which would not be a problem I guess (also I don’t know what
> the spec says about it).
>
> Imho the second option would be the cleanest. It would basically mean:
> First register every lifecycle event observer of every extension, then
> register every non-lifecycle event of every extension (and fire
> ProcessObserverMethod for every of that observer methods). This would be
> valid, too. But it’s the hardest option to implement with the current code
> base.
>
> The third variant would mean, that ProcessObserverMethod would be thrown
> again, but not every extension would get every ProcessObserverMethod event
> for every non-lifecycle-event of other extensions (which again should be no
> problem). Or we should disable that cache completely during extension
> registration.
>
> Writing that, I will take a deeper look at variant two or three.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Romain Manni-Bucau <rm...@gmail.com>
> Datum: Sonntag, 10. Oktober 2021 um 17:39
> An: openwebbeans-dev <de...@openwebbeans.apache.org>
> Betreff: Re: OWB-1393
> Hi
>
> 3 sounds the only valid option since it is valid and used to fire any event
> in extensions and is used to communicate between them from time to time.
>
> Hope it helps.
>
> Le dim. 10 oct. 2021 à 13:57, Arne Limburg <ar...@openknowledge.de>
> a écrit :
>
> > FYI,
> > I now went with solution 1 and pushed it to a branch. If there are no
> > objections, I’ll merge it tomorrow or so.
> >
> > Cheers,
> > Arne
> >
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
> > Von: Arne Limburg <ar...@openknowledge.de>
> > Datum: Sonntag, 10. Oktober 2021 um 12:34
> > An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> > Betreff: OWB-1393
> > Hi,
> >
> > I’ve created OWB-1393 and am going to fix it.
> >
> > When we find an extension that contains an observer method, that observes
> > an event that is no lifecycle event, we currently fire
> > ProcessObserverMethod during addExtension(…) (before every Extension is
> > registered). That leads to a caching problem. We cache too early (and
> thus
> > too less entries) and don’t invalidate the cache later.
> >
> > Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> > non-lifecycle event, so we have that bug currently in meecrowave (where I
> > observed it).
> >
> > That leads me to a few questions:
> >
> > Is it covered by the spec, that an extension may contain non-lifecycle
> > events?
> > If not: Should we throw an exception then, which would break CXF and thus
> > Meecrowave.
> >
> > In any case, how should we handle it?
> > 1. Don’t fire ProcessObserverMethod during extension registration at all?
> > 2. First register every Lifecycle-Event-Observer during extension
> > registration and only then register the non-lifecycle-Observers (which
> > fires the ProcessObserverMethod events)?
> > 3. Invalidate that cache after extension registration (probably the most
> > inperformant way)?
> >
> > Any opinion?
> >
> > Cheers,
> > Arne
> > OPEN KNOWLEDGE GmbH
> > Poststraße 1, 26122 Oldenburg
> > Mobil: +49 151 - 108 22 942
> > Tel: +49 441 - 4082-154
> > Fax: +49 441 - 4082-111
> > arne.limburg@openknowledge.de<ma...@openknowledge.de>
> > www.openknowledge.de<<http://www.openknowledge.de%3c>
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > <http://www.openknowledge.de%3chttps:/
> >
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> > >>
> > Registergericht: Amtsgericht Oldenburg, HRB 4670
> > Geschäftsführer: Lars Röwekamp, Jens Schumann
> >
> > Treffen Sie uns auf kommenden Konferenzen und Workshops:
> > Zu unseren Events<
> >
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> > >
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
Hi,

you can fire any Event from extensions and listen to any event in extensions with every of the three options.
The first option would have the disadvantage that an extension, that listens to ProcessObserverMethod would not receive the ProcessObserverMethod event for non-lifecycle observer methods of other extensions, which would not be a problem I guess (also I don’t know what the spec says about it).

Imho the second option would be the cleanest. It would basically mean:
First register every lifecycle event observer of every extension, then register every non-lifecycle event of every extension (and fire ProcessObserverMethod for every of that observer methods). This would be valid, too. But it’s the hardest option to implement with the current code base.

The third variant would mean, that ProcessObserverMethod would be thrown again, but not every extension would get every ProcessObserverMethod event for every non-lifecycle-event of other extensions (which again should be no problem). Or we should disable that cache completely during extension registration.

Writing that, I will take a deeper look at variant two or three.

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Romain Manni-Bucau <rm...@gmail.com>
Datum: Sonntag, 10. Oktober 2021 um 17:39
An: openwebbeans-dev <de...@openwebbeans.apache.org>
Betreff: Re: OWB-1393
Hi

3 sounds the only valid option since it is valid and used to fire any event
in extensions and is used to communicate between them from time to time.

Hope it helps.

Le dim. 10 oct. 2021 à 13:57, Arne Limburg <ar...@openknowledge.de>
a écrit :

> FYI,
> I now went with solution 1 and pushed it to a branch. If there are no
> objections, I’ll merge it tomorrow or so.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Arne Limburg <ar...@openknowledge.de>
> Datum: Sonntag, 10. Oktober 2021 um 12:34
> An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> Betreff: OWB-1393
> Hi,
>
> I’ve created OWB-1393 and am going to fix it.
>
> When we find an extension that contains an observer method, that observes
> an event that is no lifecycle event, we currently fire
> ProcessObserverMethod during addExtension(…) (before every Extension is
> registered). That leads to a caching problem. We cache too early (and thus
> too less entries) and don’t invalidate the cache later.
>
> Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> non-lifecycle event, so we have that bug currently in meecrowave (where I
> observed it).
>
> That leads me to a few questions:
>
> Is it covered by the spec, that an extension may contain non-lifecycle
> events?
> If not: Should we throw an exception then, which would break CXF and thus
> Meecrowave.
>
> In any case, how should we handle it?
> 1. Don’t fire ProcessObserverMethod during extension registration at all?
> 2. First register every Lifecycle-Event-Observer during extension
> registration and only then register the non-lifecycle-Observers (which
> fires the ProcessObserverMethod events)?
> 3. Invalidate that cache after extension registration (probably the most
> inperformant way)?
>
> Any opinion?
>
> Cheers,
> Arne
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<<http://www.openknowledge.de%3c>
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> <http://www.openknowledge.de%3chttps:/
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >>
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>

Re: OWB-1393

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

3 sounds the only valid option since it is valid and used to fire any event
in extensions and is used to communicate between them from time to time.

Hope it helps.

Le dim. 10 oct. 2021 à 13:57, Arne Limburg <ar...@openknowledge.de>
a écrit :

> FYI,
> I now went with solution 1 and pushed it to a branch. If there are no
> objections, I’ll merge it tomorrow or so.
>
> Cheers,
> Arne
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>
> Von: Arne Limburg <ar...@openknowledge.de>
> Datum: Sonntag, 10. Oktober 2021 um 12:34
> An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
> Betreff: OWB-1393
> Hi,
>
> I’ve created OWB-1393 and am going to fix it.
>
> When we find an extension that contains an observer method, that observes
> an event that is no lifecycle event, we currently fire
> ProcessObserverMethod during addExtension(…) (before every Extension is
> registered). That leads to a caching problem. We cache too early (and thus
> too less entries) and don’t invalidate the cache later.
>
> Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a
> non-lifecycle event, so we have that bug currently in meecrowave (where I
> observed it).
>
> That leads me to a few questions:
>
> Is it covered by the spec, that an extension may contain non-lifecycle
> events?
> If not: Should we throw an exception then, which would break CXF and thus
> Meecrowave.
>
> In any case, how should we handle it?
> 1. Don’t fire ProcessObserverMethod during extension registration at all?
> 2. First register every Lifecycle-Event-Observer during extension
> registration and only then register the non-lifecycle-Observers (which
> fires the ProcessObserverMethod events)?
> 3. Invalidate that cache after extension registration (probably the most
> inperformant way)?
>
> Any opinion?
>
> Cheers,
> Arne
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limburg@openknowledge.de<ma...@openknowledge.de>
> www.openknowledge.de<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> <http://www.openknowledge.de%3chttps:/
> eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0
> >>
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
> Zu unseren Events<
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0
> >
>

AW: OWB-1393

Posted by Arne Limburg <ar...@openknowledge.de>.
FYI,
I now went with solution 1 and pushed it to a branch. If there are no objections, I’ll merge it tomorrow or so.

Cheers,
Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>

Von: Arne Limburg <ar...@openknowledge.de>
Datum: Sonntag, 10. Oktober 2021 um 12:34
An: dev@openwebbeans.apache.org <de...@openwebbeans.apache.org>
Betreff: OWB-1393
Hi,

I’ve created OWB-1393 and am going to fix it.

When we find an extension that contains an observer method, that observes an event that is no lifecycle event, we currently fire ProcessObserverMethod during addExtension(…) (before every Extension is registered). That leads to a caching problem. We cache too early (and thus too less entries) and don’t invalidate the cache later.

Note: org.apache.cxf.cdi.JAXRSCdiResourceExtension observes a non-lifecycle event, so we have that bug currently in meecrowave (where I observed it).

That leads me to a few questions:

Is it covered by the spec, that an extension may contain non-lifecycle events?
If not: Should we throw an exception then, which would break CXF and thus Meecrowave.

In any case, how should we handle it?
1. Don’t fire ProcessObserverMethod during extension registration at all?
2. First register every Lifecycle-Event-Observer during extension registration and only then register the non-lifecycle-Observers (which fires the ProcessObserverMethod events)?
3. Invalidate that cache after extension registration (probably the most inperformant way)?

Any opinion?

Cheers,
Arne
OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limburg@openknowledge.de<ma...@openknowledge.de>
www.openknowledge.de<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0<http://www.openknowledge.de%3chttps:/eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9vRVYZVZ%2Feqk%2BvFxU5COofNvgs8U0AxtxRqwVEwqXHA%3D&reserved=0>>
Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:
Zu unseren Events<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.openknowledge.de%2Fevent%2F&data=04%7C01%7C%7C3004d8758be44c8678c008d93bcc1e23%7C48837bc476f9481d8a76bd7b60b43dec%7C0%7C0%7C637606570139932909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8tjmukdm1NxhXQMkn4VnESiBI216kXvh%2Fjb7%2FFYI0kE%3D&reserved=0>