6.2.1.4 Module Finalization

The finalize function is called after each servlet is run, regardless of the exception status. This function can be used to perform actions after the servlet has run, and it can perform different actions based on the exception status of the servlet. Create a function with the following signature:

finalize( mod, req, success)
mod, req and success represent the module object, the apache request object, and a boolean flag respectively. The module object is the same module object that was passed in the initialize function above. The request object is defined in the mod_python documentation, provided to allow your plugin to interact with the apache request. The success flag is true if there was no uncaught exception at the end of the servlet, false if there was an uncaught exception.

If the module does not contain a finalize function, then the plugin will not be loaded.