John,

If you have called Server.setGracefulShutdown(int ms) the shutdown should
not cause much
disruptions to users, as it will stop the connectors accepting any new
connections and then
wait the designated number of ms for existing requests to drain out of the
context.

Alternatively, you might not have to stop the whole server, you should just
be able to
stop the webapp. You might need to stop the connectors too.

The sequence would be something like:

+ call close() on all of the connectors
+ call setShutdown(true) on the WebAppContext
+ wait for a little while for existing requests to drain out
+ call stop() on the WebAppContext
+ call start() on the WebAppContext
+ call open() on the connectors

If you don't have direct references to all of these objects you can access
them via jmx.

Jan

On 19 July 2011 00:54, John English <[email protected]> wrote:

> I have a webapp running on Jetty 7, and I can update it by copying new
> class files to WEB-INF/classes and then restarting the server. This can
> cause problems if any users are connected at the time. What I'd like to
> be able to do is set a flag to ask the webapp to restart and use a
> SessionListener to restart the webapp when the last user logs out.
>
> The question is, is there any way to restart either a webapp or Jetty
> itself from inside a SessionListener like this?
>
> TIA,
>
> ------------------------------**------------------------------**
> ------------
>  John English | My old University of Brighton home page is still here:
>              | 
> http://www.it.brighton.ac.uk/**staff/je<http://www.it.brighton.ac.uk/staff/je>
> ------------------------------**------------------------------**
> ------------
> ______________________________**_________________
> jetty-users mailing list
> [email protected]
> https://dev.eclipse.org/**mailman/listinfo/jetty-users<https://dev.eclipse.org/mailman/listinfo/jetty-users>
>
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to