tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Listener Shutdown Order?
Date Wed, 14 Nov 2007 18:33:55 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jim,

Jim Garrison wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>>
>> "Notification that the servlet context is *about* to be shut down. All
>> servlets and filters have been destroy()ed before any
>> ServletContextListeners are notified of context destruction."
> 
> What I'm seeing is that servlet destroy() is being called AFTER the
> listeners have been shutdown.  If I'm reading the quote above right,
> this shouldn't happen; servlets should have already been destroy()ed
> before the listener is shutdown.  


I checked the Tomcat 5.5 source, and this is what happens in
StandardContext.stop():

.
.
.
            // Stop our child containers, if any
            Container[] children = findChildren();
            for (int i = 0; i < children.length; i++) {
                if (children[i] instanceof Lifecycle)
                    ((Lifecycle) children[i]).stop();
            }

            // Stop our filters
            filterStop();

            // Stop our application listeners
            listenerStop();
.
.
.

In this case, "children" refers to the servlets and stuff like that
(actually wrappers thereof). The stopping does not look threaded, so I
can only assume that either the logging is playing tricks on you, or one
of your components is doing something strange like threading its own
shutdown.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOz+T9CaO5/Lv0PARAoPDAJ9keKihPpFixoRST+K9bXQ+huvpQQCguEhF
5NXTdxJsZ7O79w+PZg5acQs=
=8Pyj
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message