I need to react on an event that informs that complete application startup is finished to bootstrap application before it is used to avoid first request delay. For that I used AfterDeploymentValidation event and CDI extension that is fired when CDI completes initialization and that works well on JBoss AS7 but unfortunately this event is not fired when running in hosted mode. I think this is due to valdiation phase on CDI deployment is disabled by errai CDI listener that is defined in web.xml instead of default weld listener.
I followed this example on how to make CDI bean to start up during application start.
Tried to listen on weld se events like ContainerInitialized but that was not fired either. So question is is there any other event that application can listen to to be notified when application is started that will work on both AS7 and hosted mode? Maybe there are some errai events that could be of use here.
Thanks a lot for help
Good news: org.jboss.errai.container.CDIServletStateListener is officially deprecated in Errai 2.2.0, and completely removed in Errai 3.0.x.
You can just change your <listener-class> entry to org.jboss.weld.environment.servlet.Listener and go back to your original plan of hooking into AfterDeploymentValidation.
Hope that helps,
|Retrieving data ...|