You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Cain <cc...@mhsoftware.com> on 2001/08/07 07:31:36 UTC
Re: Catalina Startup Hook (actually, both camps should read this :-)
Quoting "Craig R. McClanahan" <cr...@apache.org>:
>
> Valves are designed for request processing, not component startup and
> shutdown. See below for an alternative suggestion.
Yep, that's the general conslusion I came to in looking over the codebase.
Cool, at least I know I can still RTFS and get it right (on occasion) :-)
> The simplest approach to your particular issue would be to create a
> class that implements the org.apache.catalina.LifecycleListener interface,
> and then nest a <Listener> element inside the SSL-based <Connector>
> element that creates an instance of that listener, associated with the
> correspondeing connector.
>
> Now, the lifecycleEvent() method will be fired when this Connector is
> started up (and when it is shut down), so you can interject your
> dialog with the user at that point. Just look for an event of type
> Lifecycle.START_EVENT.
Exactly what I needed to know. Thanks!
> Note that the <Lifecycle> element, like most elements in server.xml,
> can dynamically map the XML attributes specified in the <Listener> element
> to corresponding bean properties on your LifecycleListener class. This
> is tremendously useful for configuring the behavior of your listener.
> The only required attribute is "className", which specifies the fully
> qualified classname of your class itself.
>
> It won't help for this particular use case, but lifecycle listeners
> can also be nested inside <Engine>, <Host>, and <Context> elements,
> depending on what kind of startup and shutdown events you care about.
WARNING: KODAK MOMENT TO FOLLOW ...
Man ... after more than a year, I am FINALLY starting to understand why the
whole 3.x vs 4.0 war was so fiercely waged. In the process of implementing this
little module of mine for both trees, I have to say that they are BOTH, really,
damn clever solutions. I mean, I'm sure the resident experts in each camp each
have their little nitpicks with the other codebase. But I have to say, from
someone without a great deal of personal investment in either tree in
particular, ALL of you people should be damn proud. Costin (et. al) with his
hooks and interceptors ... Craig (et. al) with his valves and listeners ... you
guys and your respective posses have BOTH designed an incredible product. The
more I dig into both trees, the more impressed I am with both. As far as I'm
concerned, personally, arguing over which is the superior design would be alot
like arguing over whether to take the Porche or the Jag out for a spin. People
might have their slight personal preferences, but at the end of the day, your
driving a DAMN fine machine either way.
Anyway, I'm not trying to stir up anything at all, and I DEFINITELY don't want
to drag the 3 vs 4 thing back out of the closet. (PLEEEEASE, if there are any
list newbies reading, do NOT reply to this with some kind of feature comparison
or other opinion on which is better ... you'll get me in all sorts of trouble
in here :-) I just wanted to say what I didn't have the knowledge or experience
to say at the time: the greatest testament to the entire Tomcat project is the
fact that we were fortunate enough to be in the akward position of deciding
between these two codebases. Because I GUARANTEE you, any strictly-proprietary
software vendor on the planet would absolutely SALIVATE if given the chance to
have originally based a closed, commercial product on either one of these two
designs. You could kick the crap out the competition with either of them (the
other codebase excluded, of course ;-) ... they're that good.
Anyway, that's just how I feel, and I look forward to continuing work in both
(easy for me to say, I like to develop plugins =)
Regards,
Christopher
Re: Catalina Startup Hook (actually, both camps should read this
:-)
Posted by Jon Stevens <jo...@latchkey.com>.
on 8/6/01 10:31 PM, "Christopher Cain" <cc...@mhsoftware.com> wrote:
> But I have to say, from
> someone without a great deal of personal investment in either tree in
> particular, ALL of you people should be damn proud.
Wouldn't it be amazing if they had just worked together though?
All that great talent working on two different (yet the same!) things seems
like such a shame to me! :-)
-jon