ScheduledExecutorService方法

时间:2014-03-29 01:16:07

标签: java spring hibernate jsf primefaces

嗨我在我的应用程序中遇到以下问题,我正在使用一个名为timer()的方法,并且在不认识我的应用程序的视觉内部,即视图的不同组件,如果它们在此刻...干杯并事先感谢

public void temporizador() {

    System.out.println("Entro a TEMPORIZADOR");         
     ses = Executors.newScheduledThreadPool(1);

        // Ejecutar dentro de 4 segundos, repetir cada 3 segundos
        ses.scheduleAtFixedRate(this, 4 * 1000, 3 * 1000, TimeUnit.MILLISECONDS);

}

public void run() {

    System.out.println("Entro a RUN");  

    FacesContext fc = FacesContext.getCurrentInstance();
    if(fc != null){
        UIComponent comp0 = fc.getViewRoot().findComponent("form_dashboard:id_office0");
        UIComponent comp1 = fc.getViewRoot().findComponent("form_dashboard:id_office1");
        UIComponent comp2 = fc.getViewRoot().findComponent("form_dashboard:id_office2");
        UIComponent comp3 = fc.getViewRoot().findComponent("form_dashboard:id_office3");
        UIComponent comp4 = fc.getViewRoot().findComponent("form_dashboard:id_office4");
        UIComponent comp5 = fc.getViewRoot().findComponent("form_dashboard:id_office5");
        UIComponent comp6 = fc.getViewRoot().findComponent("form_dashboard:id_office6");
        UIComponent comp7 = fc.getViewRoot().findComponent("form_dashboard:id_office7");
        UIComponent comp8 = fc.getViewRoot().findComponent("form_dashboard:id_office8");

    }  }

0 个答案:

没有答案