What features might I be using to display a notification on a page if an Exception occurs inside a ServletContextListener that runs a thread?
The idea is to warn the user that something is out of the ordinary and stay fixed until the problem is resolved.
public class Application implements ServletContextListener {
@Inject
private RadiusServerImpl server;
@Inject
private Logger log;
public Application() {
// TODO Auto-generated constructor stub
}
public void contextDestroyed(ServletContextEvent sce) {
log.info("Parando aplicações...");
server.stop();
}
public void contextInitialized(ServletContextEvent sce) {
log.info("Iniciando aplicações...");
try{
server.start(true, true);
} catch (Exception e){
// ENVIA UMA MENSAGEM AOS MANAGED BEANS (EXIBIR EM QUALQUER PÀGINA)
}
}
}
Application running in Jboss EAP with JSF, EJB, CDI, HIBERNATE.