tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <>
Subject Re: Coyote/jk2 - interaction explanations please
Date Thu, 18 Apr 2002 19:15:39 GMT
> On Thu, 18 Apr 2002, Remy Maucherat wrote:
> >
> > I don't know any differences in the thread handling between 4.0 and 4.1.
> > What is the problem ?
> You're right, my mistake.
> There are 2 problems.
> The first was that when you call main(), the method will never return.
> In 3.x main() starts some deamon threads and initialize everything, then
> it returns. That serves as an indication that the server was started ( for
> things like ant or other tools embeding it ).
> That's easy to solve, I call main in a separate thread now.
> The hard problem - and I really need help on this one - the 8005
> and shutdown protocol.
> First, if jk and ajp13 is used - people may want to use the shutdown
> command in ajp13 and keep a single port open. If JNI is used, the shutdown
> is tied to the apache ( or IIS, etc) process shutdown.
> More important - in multi-process apache there is a 'natural' load
> balancing - each apache process will run a tomcat VM and those will
> be load balanced. That's the tricky part and the main obstacle in getting
> JNI working.
> What I need is a way to disable the 8005. For example if I set the value
> to 0 in server.xml, catalina should not open the port ( if you really
> want the main thread blocked as long as catalin runs you can do a simple
> while( running ) this.wait() ).

Instead of using the Bootstrap class, use the BoostrapService class. It does
exactly the same but it doesn't listen on a socket for shutdown (instead,
you have to call stop on the same instance), and it does return (instead of
blocking on an await).

That's the class I use when running as a NT service (I ran into the same
problem, obviously), and it works really well.


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

View raw message