|
From: Leif M. <le...@ta...> - 2003-10-25 03:07:10
|
Ole,
Assuming that you have a way of telling when the JVM will really be
ready to exit,
there are a few ways to do this.
The easiest would be to register a shutdown thread which is started
when the JVM
starts to shutdown. It would then continue to run until all of your
clients have
completed.
The problem (feature) is that the Wrapper will by default kill the
JVM after about
30 seconds. To prevent this, you will need to tell the Wrapper that the
JVM needs
more time.
One way of doing this is to extend the shutdown timeout in the
wrapper.conf file.
This has the drawback of not knowing if the JVM needs more time or is
really hung
on shutdown however.
A better method would be to have your shutdown loop call
WrapperManager.signalStopping( Nms ); Each time this method is called, the
Wrapper will be sure to allow that much time before the Wrapper gives up
and kills
the JVM.
So if your shutdown thread calls WrapperManager.signalStopping(
30000 ) every
10 seconds or so, the JVM would always quit within 30 seconds of your
shutdown
hook completing even if the JVM got stuck for some reason.
Let me know if you have any questions. Allowing the JVM to run for
relatively
long periods of time after the JVM has been requested to exit is not the
norm. The
Wrapper supports it, but there are not many examples out there.
Cheers,
Leif
Ole Christian Meldahl wrote:
>
> My application is an RMI server that I want to put under Wrapper
> (great tool btw)
>
> I do have on problem, currently we stopping the server will
> 1. Block further connections
> 2. Unregister from rmiregistry
> 3. Stay alive until no more current clients
> 4. Shutdown JVM
>
> Is it possible to mimic this so that the
> myapp stop
> command will only execute the shutdown method and then leave the JVM
> running until it decides on it self to go down?
>
> olec
|