Send message to all managed beans

0

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.

    
asked by anonymous 03.10.2015 / 08:26

1 answer

1

CDI events can help you solve your problem as described here .

    
15.10.2015 / 19:25