CAF Application initialization & object cleanup

I have a CAF application (AppTest) with multiple portlets (Portlet A, Portlet B). I have created a custom pojo for object caching (singleton). When the caching object is created first time it loads all the application wide properties into the cache. I am looking for solution to achieve following

  1. To instantiate the singleton object (load the cache) during application startup. I guess if I put this logic in portlet initialize method then the first request to the application may take a hit. So how should I preload the cache before the first request is handled by my application (similar to load-on-startup for servlet).
  2. Where to provide clean up logic. I want to call a destroy method in my singleton object to shutdown the cache before the application is brought down.

I guess one way to achieve this is by using lifecycle method of javax.Servlet.ServletContextListener (correct me if I am wrong)

Any other preferred way in WM7.1 ?

Using ServletContextListener in your web application is a correct and preferred way of doing application wide initialization and clean up

Alex