users@glassfish.java.net

Reload config for a TimerTask OR restart glassfish from java ee application

From: <glassfish_at_javadesktop.org>
Date: Mon, 30 Jun 2008 04:56:24 PDT

I have a java ee application (packaged in an ear) that includes a ServletContextListener that starts and stops TimerTasks upon server startup and shutdown. These TimerTasks are configured in a database and I would like to be able to "reload" this config at the whim of the user. If the admin user changes the config, the glassfish server needs to be restarted to trigger the stop and start.

I would prefer another solution to this than restarting glassfish. But if no such solution exists, I would like to know how I can restart glassfish from within the java program.

The app runs on linux (Debian) and I've created a startup-script which also includes a restart-option. I could of course run this script, but this solution would not be portable across operating systems.

Cheers
// Marius
[Message sent by forum member 'mariusw' (mariusw)]

http://forums.java.net/jive/thread.jspa?messageID=283323