-
1. Re: Need to execute method on Shutdown
mikefinn Feb 1, 2003 8:32 AM (in response to rvaneperen)I don't know of any such mechanism. I imagine you'll have to implement an MBean and do your cleanup in the stopService method, but I don't know if the MBean shutdown order is deterministic. This means that access to the resources you need to clean up may not be there by the time the stopService() gets invoked. Alternatively, the only way I can think of is to extend Server or Shutdown classes.
If I may ask - what kind of cleanup are you doing? There may be a 'better way'...
mike -
2. Re: Need to execute method on Shutdown
pmilosevic Apr 6, 2006 5:15 AM (in response to rvaneperen)I have the same problem as rvaneperen.
My application is establishing dialup connections and I want to disconnect all active connections during JBoss shutdown.
I've tried to use MBean stopService method but it's executed after undeployment of some resources I need to access to perform cleanup.
Any other suggestion? -
3. Re: Need to execute method on Shutdown
starksm64 Apr 6, 2006 12:38 PM (in response to rvaneperen)Then you need to have a depends on those resources so that you are shutdown before them.
-
4. Re: Need to execute method on Shutdown
sony3002 Apr 6, 2006 3:00 PM (in response to rvaneperen)if you are deploying web application with jboss then you can use ServletContextListener for this
Sony -
5. Re: Need to execute method on Shutdown
pmilosevic Apr 10, 2006 6:44 AM (in response to rvaneperen)Thank you, setting dependecies helped.