Thanks, that's interesting.
But meanwhile I found a more generic approach:
In the StartupServlet that I use for initialization tasks I implement a destroy() method, which then executes cleanup tasks. The servlet's destroy method is automatically invoked by the container (and I remain J2EE-server independent, because I do not. use JBoss-specific features).
Best regards from sunny Black Forest, Germany,