IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

CAF Application initialization & object cleanup

  • 1.  CAF Application initialization & object cleanup

    Posted Thu September 25, 2008 10:58 PM

    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.

    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 2.  RE: CAF Application initialization & object cleanup

    Posted Thu September 25, 2008 11:27 PM

    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 ?


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 3.  RE: CAF Application initialization & object cleanup

    Posted Fri September 26, 2008 06:18 PM

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

    Alex


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine