-
1. Re: Shutdown hook issue
f_marchioni Jan 25, 2010 10:33 AM (in response to danydyn)Interesting approach to solve the problem. Have you checked if it's an issue related with the IDE you're using ?
As an alternative, you might consider registering an MBean:
public class StartupService extends
ServiceMBeanSupport implements StartupServiceMBean {
public StartupService() { }
. . . .
@Override
protected void stopService() throws Exception {
log.info("[StartupService ] Stopping Startup Mbean");
}
}
stopService should kick in when the shutdown of the server is in progress.....
hope it helps,
Francesco
-
2. Re: Shutdown hook issue
danydyn Jan 25, 2010 10:42 AM (in response to f_marchioni)Thank you for answering,
I use MyEclipse, it just calls org.Jboss.Shutdown with --shutdown argument.
I'll give the JMX approach a try, but still, I'm puzzled...
-
3. Re: Shutdown hook issue
danydyn Jan 26, 2010 4:40 AM (in response to danydyn)I loaded the server from command line with run.bat, stopped it with ctrl-c in the console,
and guess what... it did not halt.
Which means that probably the problem lyes with myeclipse.
Thank you Fransesco for pointing it up for me.
Daniel
-
4. Re: Shutdown hook issue
f_marchioni Jan 26, 2010 5:19 AM (in response to danydyn)glad it helped.
By the way, I had a peaceful morning so I had time to write a small article on my blog about it :
http://www.mastertheboss.com/en/jboss-server/237-intercepting-jboss-shutdown.html
regards
Francesco
-
5. Re: Shutdown hook issue
danydyn Jan 26, 2010 6:43 AM (in response to f_marchioni)I would also suggest the context listener approach - implement ServletContextListener and overridecontextDestroyed method.