I'm also really looking for this, does anyone know how to catch such an event? Is it possible that, if a webmodule has been deployed, or wil be undeployed, an event is thrown that could be called by certain objects? Thank very much in advance!
yes this can be done for ejbs and such, but i'm not sure how easy the process would be to hook into the tomcat deployer (or jetty if you are using that instead).
to detect that you've undeployed an ear/jar/etc you could write a custom mbean that registers itself w/ the deployer (not the main deployer, you need to register w/ the jar deployer, ear deployer, etc).
then when a package is deployed/undeployed, your mbean will be notified and you can do whatever.
I found something with might make it possible, but it's in J2EE 1.4 which still is only partly implemented in the JBoss 4 Development release. I've reviewed the apidoc @ http://java.sun.com/j2ee/1.4/docs/api/index.html, and ProgressEvent, ProgressListener and ProgressObject might do the job (but i'm still not really sure about that). But I've choosen another strategy to solve my problem, so I don't need the feature any more at the moment.
Thanks for your reply