tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Duplicate events in Lifecycle?
Date Wed, 09 Feb 2011 10:57:18 GMT
On 09/02/2011 09:14, Konstantin Kolinko wrote:
> 1) Browsing the code in o.a.c.startup.Embedded#stopInternal() I see
> the following two lines:
> 
>         fireLifecycleEvent(STOP_EVENT, null);
>         setState(LifecycleState.STOPPING);
> 
> Unless I miss something it means that STOP_EVENT is fired twice, once
> by the fireLifecycleEvent() call and second time by setState().
> 
> 
> 2) Lifecycle#setState() does not check that new state != old state. It
> always fires a lifecycle event on every call.
> 
> I see that some 3rd party components that extend ours (like the one
> mentioned in BZ 50738) call this.setState(STARTING), then call
> super.startInternal() that may fire the event second time.
> 
> Shouldn't we avoid firing duplicate events?

We should fix where we do it. 1 looks like a left-over from my refactoring.

I don't think we should protect against 2.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message