As soon as the shutdown command is given, the container will close the connectors so that they do not accept any more inbound connections. This will inform most load balancers that the server is no longer part of the cluster. The contexts are closed so that they do not accept any more requests, but the requests currently inside the container will drain out and the Server instance will shutdown after the grace period expires.
You must also call the
setStopAtShutdown(boolean) method with a value of true for the grace period to take effect.
APIs For Shutdown Implementation