EJB application shutdown hook
Use @Singleton
bean and implement @PreDestroy
:
@Startup
@Singleton
public class HookBean {
@PreDestroy
void wholeApplicationShuttingDown {
}
}
UPDATE: Just noticed ejb-3.0
tag. @Singleton
was added in 3.1. But still maybe you will find it useful.