Re: [jetty-users] Restarting webapp programmatically?

2011-07-19 Thread John English

On 19/07/2011 03:55, Jan Bartel wrote:

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.


OK, I have this anyway. However, the server is only running the one
webapp, and users have to log in. I have a SessionListener that monitors
the number of logged in users, so what I want is to restart as soon as
the last user logs out (I don't want to kill any existing sessions).


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.


Restarting the webapp will reload the class files, yes?


The sequence would be something like:

+ call close() on all of the connectors
+ call setShutdown(true) on the WebAppContext


I don't see setShutdown from JMX...


+ wait for a little while for existing requests to drain out


Presumably not needed if no-one is logged in?


+ call stop() on the WebAppContext
+ call start() on the WebAppContext
+ call open() on the connectors


So, I'll try this from inside the session listener and see what
happens...

Many thanks,


 John English | My old University of Brighton home page is still here:
  | http://www.it.brighton.ac.uk/staff/je

___
jetty-users mailing list
jetty-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/jetty-users


[jetty-users] Restarting webapp programmatically?

2011-07-18 Thread John English

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

___
jetty-users mailing list
jetty-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/jetty-users