Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 82556 invoked from network); 9 Feb 2011 11:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2011 11:00:58 -0000 Received: (qmail 71950 invoked by uid 500); 9 Feb 2011 11:00:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 71307 invoked by uid 500); 9 Feb 2011 11:00:55 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 71297 invoked by uid 99); 9 Feb 2011 11:00:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 11:00:54 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [193.252.22.190] (HELO smtp6.freeserve.com) (193.252.22.190) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 11:00:44 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3629.me.freeserve.com (SMTP Server) with ESMTP id 053DE7000091 for ; Wed, 9 Feb 2011 12:00:24 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3629.me.freeserve.com (SMTP Server) with ESMTP id EC4EC7000095 for ; Wed, 9 Feb 2011 12:00:23 +0100 (CET) Received: from mail.homeinbox.net (unknown [91.111.128.243]) by mwinf3629.me.freeserve.com (SMTP Server) with ESMTP id CE5187000091 for ; Wed, 9 Feb 2011 12:00:23 +0100 (CET) X-ME-UUID: 20110209110023845.CE5187000091@mwinf3629.me.freeserve.com Received: from localhost (localhost [127.0.0.1]) by mail.homeinbox.net (Postfix) with ESMTP id E65A9EAA6EA for ; Wed, 9 Feb 2011 11:00:27 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at homeinbox.net Received: from mail.homeinbox.net ([127.0.0.1]) by localhost (mail.homeinbox.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nq-rxlrtao5r for ; Wed, 9 Feb 2011 11:00:23 +0000 (GMT) Received: from s2laptop.local (unknown [62.28.47.6]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.homeinbox.net (Postfix) with ESMTPSA id 71691EAA6E6 for ; Wed, 9 Feb 2011 11:00:19 +0000 (GMT) Message-ID: <4D52730E.6050905@apache.org> Date: Wed, 09 Feb 2011 10:57:18 +0000 From: Mark Thomas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: Duplicate events in Lifecycle? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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