The org.zkoss.zk.ui.util.WebAppInit interface
From Documentation
WebAppCleanup is implemented by a listener class that will be used to cleanup a ZK application that is being destroyed.
When a ZK application is going to be destroyed, it invokes the cleanup method of this interface such that developers could plug the application-specific codes to cleanup the application.