D. How to customize a UWS ?

9. The interface HttpSessionBindingEvent

When a session is finishing the contained UWS is not accessible anymore through a servlet. It can cause some problems. Indeed if all jobs of the previous session are still running, they continue to hold resources and so the performances of your computer are decreasing.

In order to clear all UWS resources (stop threads and timers, delete files, ...) when a session is finishing, the class AbstractUWS implements the interface HttpSessionBindingListener. This interface contains two methods:

These two methods are already implemented but can be overrided. By default valueBound(HttpSessionBindingEvent) does nothing except printing a message. valueUnbound(HttpSessionBindingEvent) calls the method removeAllJobLists() which calls the method clearResources() for all Jobs of all managed JobLists.