initialisation Module EJB auditeur
Question
Il est possible de définir un écouteur pour .jar EJB 3.0 qui est appelé dans l'initialisation du module / contexte? Semblable à la ServletContextListener pour le projet web?
La solution
AFAIK, pas avec EJB 3.0. Avec EJB 3.1, vous pouvez utiliser un Singleton EJB pour le faire.
De Application de démarrage / arrêt Callbacks:
1: @Startup
2: @Singleton
3: public class FooBean {
4:
5: @PostConstruct
6: void atStartup() { ... }
7:
8: @PreDestroy
9: void atShutdown() { ... }
10:
11: }
Voir cette réponse pour plus de détails.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow