I guess you can intercept the org.jboss.system.server.stopped notification:
http://wiki.jboss.org/wiki/Wiki.jsp?page=NotificationsEmittedByJBossMBeans
You can combine that with a BarrierController. See the example here, it's more or less
tailored to what you want:
http://wiki.jboss.org/wiki/Wiki.jsp?page=BarrierControllerExample
Just write an mbean service of yours, that in its "stopService" method invokes
the shutdown logic on your Session Bean".
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096465#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...