You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Ron Smeral <rs...@redhat.com> on 2012/07/19 21:02:52 UTC

Firing container lifecycle events out of order

Hi all,


my question is: is firing container lifecycle events from event handlers 
out of their defined order OK? I noticed that all DeltaSpike extensions 
expect the events to be fired in the spec-defined order (otherwise NPEs 
occur). However, I ran into a scenario (though experimental) where the 
ProcessAnnotatedType event is fired programmatically from the 
BeforeBeanDiscovery handler. It happens e.g. in Solder's XmlConfigExtension.
Should such behaviour be taken into account? Did I miss some line in the 
spec saying firing container lifecycle events out of order is banned? Or 
is it just expected not to happen?


Regards,

-- 
Ron Smeral
JBoss QE Associate
Brno


Re: Firing container lifecycle events out of order

Posted by Ron Smeral <rs...@redhat.com>.
Well yes, I too see it as "bad behaviour". But it seems it is plausible 
(happens in Solder) and not banned by the spec (it doesn't explicitly 
state that system events shouldn't be fired using BeanManager.fireEvent).

On 19.7.2012 21:12, Mark Struberg wrote:
> What do you mean with 'programmatically'?
>
> The spec defines a clearly defined boot order imo. An Extension must not fire System events itself at all! This will not be portable in most cases.
>
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
>> From: Ron Smeral<rs...@redhat.com>
>> To: deltaspike-dev@incubator.apache.org
>> Cc:
>> Sent: Thursday, July 19, 2012 9:02 PM
>> Subject: Firing container lifecycle events out of order
>>
>> Hi all,
>>
>>
>> my question is: is firing container lifecycle events from event handlers out of
>> their defined order OK? I noticed that all DeltaSpike extensions expect the
>> events to be fired in the spec-defined order (otherwise NPEs occur). However, I
>> ran into a scenario (though experimental) where the ProcessAnnotatedType event
>> is fired programmatically from the BeforeBeanDiscovery handler. It happens e.g.
>> in Solder's XmlConfigExtension.
>> Should such behaviour be taken into account? Did I miss some line in the spec
>> saying firing container lifecycle events out of order is banned? Or is it just
>> expected not to happen?
>>
>>
>> Regards,
>>
>> -- Ron Smeral
>> JBoss QE Associate
>> Brno
>>

Regards,

-- 
Ron Smeral
JBoss QE Associate
Brno


Re: Firing container lifecycle events out of order

Posted by Mark Struberg <st...@yahoo.de>.
What do you mean with 'programmatically'?

The spec defines a clearly defined boot order imo. An Extension must not fire System events itself at all! This will not be portable in most cases.


LieGrue,
strub



----- Original Message -----
> From: Ron Smeral <rs...@redhat.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Thursday, July 19, 2012 9:02 PM
> Subject: Firing container lifecycle events out of order
> 
> Hi all,
> 
> 
> my question is: is firing container lifecycle events from event handlers out of 
> their defined order OK? I noticed that all DeltaSpike extensions expect the 
> events to be fired in the spec-defined order (otherwise NPEs occur). However, I 
> ran into a scenario (though experimental) where the ProcessAnnotatedType event 
> is fired programmatically from the BeforeBeanDiscovery handler. It happens e.g. 
> in Solder's XmlConfigExtension.
> Should such behaviour be taken into account? Did I miss some line in the spec 
> saying firing container lifecycle events out of order is banned? Or is it just 
> expected not to happen?
> 
> 
> Regards,
> 
> -- Ron Smeral
> JBoss QE Associate
> Brno
>