tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Jk2 shutdown
Date Mon, 01 Jul 2002 19:31:13 GMT
On Mon, 1 Jul 2002, Mladen Turk wrote:

> > On Mon, 1 Jul 2002, Mladen Turk wrote:
> > 
> > We already have a mechanism/API for shutdown - and I don't 
> > see any good reason to add another one for the JNI call. The 
> > fewer 'special' APIs we have for JNI, the better it is for 
> > maintainance.
> >
> Yes, but It doesn't work, at least I wasn't been able to invoke it.
> And it isn't API, it just calls the TomcatStarter with the stop param,
> and the change of ARG init param, enables that 'stop' to be customizable
> (if its gonna be changed someday).

I was thinking that 'stop' should be done by sending the ajp13
stop message, instead of calling main().

worker.jni should just execute a program by calling 
static main(String args[]).

What about having a separate worker.jni: that will execute the 
stop command ? In theory we can have as many worker.jni we want,
each executing different programs - in this case we'll just add
 a flag to the worker.jni indicating when do we want the program 
executed ( on start, on stop - maybe on other stages too ). This 
would still keep the worker.jni: as a simple 
run-java-program-and-nothing-else, and we could open some interesting

> > What I would do is just use the existing ajp13 shutdown. If 
> > there's anything the TomcatStarter must do on shutdown, we 
> > can add another  hook (== coyote ActionCode ) for shutdown, 
> > but use the normal callback mechansim from JNI ( with the 
> > ajp13 shutdown message ).
> >
> We still need to destroy the jvm on shutdown, and since we are using the
> TomcatStarter for starting I'm pretty much in favor for using it for
> shutdown too, cause that's our application entry point when used
> inprocess.

Not sure about that - I would like to keep TomcatStarter as simple as 
possible. I don't agree that the same class that starts a program
should also stop it - we don't do it in standalone case ( where the 
stopper sends a message to either ajp12/13 in 3.3, or the 8005 port
in catalina - but that's different code than the starter code ).

As allways, if adding a stop solves your problem - I'm +0, but
I don't think this is the best solution, and long term I would like
very much to have the stop done via the same code regardless of
execution mode.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message