File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Cleaning up for classes in common/lib or shared/lib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cleaning up for classes in common/lib or shared/lib" Watch "Cleaning up for classes in common/lib or shared/lib" New topic
Author

Cleaning up for classes in common/lib or shared/lib

Tushar Madhukar
Ranch Hand

Joined: May 03, 2006
Posts: 36
Hi,

I have a scenario where there are several contexts running in the Tomcat container and all are using a few common classes, which are in JAR files in shared/lib directory.

I want to do some clean up in these shared classes before Tomcat is shut down e.g. there are open DB connections, threads running etc. I need to close them properly before Tomcat stops. How can this be done? Can my shared classes provide callbacks, which can be invoked by Tomcat? Basically, I am looking for something like ServletContextListener.contextDestroyed() method for shared classes.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cleaning up for classes in common/lib or shared/lib