1 33 34 package com.icesoft.tutorial; 35 36 import com.icesoft.faces.webapp.xmlhttp.PersistentFacesState; 37 38 42 public class Ticker implements Runnable { 43 44 47 private int pollInterval = 1000; 48 49 public Ticker() { 50 Thread ticker = new Thread (this); 51 ticker.start(); 52 } 53 54 58 public String getStarted() { 59 return ""; 60 } 61 62 public void run() { 63 try { 64 while (0 != pollInterval) { 65 PersistentFacesState state = PersistentFacesState.getInstance(); 66 67 Thread.sleep(pollInterval); 68 if (null != state) { 69 state.render(); 70 } else { 71 System.out.println("null PersistentFacesState"); 72 break; 73 } 74 } 75 } catch (Exception e) { 76 System.out.println(e); 77 } 78 } 79 80 } 81 | Popular Tags |