What server are you using?. If its weblogic 8.1, there is a very high chance that weblogic JMX might do this for you. You can register JMX Notification listerners with the MBeans you are interested in. In this case, EJB Mbean may be.
Nope the ejb spec does not talk about notifications before/after deployment/undeployment. Either way i'm curious to know the use case that you are trying to address through those notifications.