1 2 24 25 package com.lutris.appserver.server.sessionEnhydra; 26 27 import com.lutris.appserver.server.Application; 28 import com.lutris.appserver.server.Enhydra; 29 import com.lutris.logging.Logger; 30 31 39 public class PagedSessionThresholdTimer extends Thread { 40 41 private PagedSessionHome home; 42 private Application app; private boolean done = false; 44 45 51 public PagedSessionThresholdTimer(PagedSessionHome home, 52 Application app) { 53 this.home = home; 54 this.app = app; 55 setDaemon(true); 56 } 57 58 61 public void run() { 62 Enhydra.register(app); 63 long scanInterval = 0; 64 while (!done) { 65 try { 66 scanInterval = home.checkPassiveSessions(); 67 } catch (Exception e) { 68 Enhydra.getLogChannel().write(Logger.ALERT, 69 "Failed to check idle sessions: " + e, e); 70 } 71 try { 72 sleep(scanInterval); 73 } catch (InterruptedException e) { 74 } 76 } 77 Enhydra.unRegister(); 78 } 79 80 83 public void shutdown() { 84 done = true; 85 } 86 } 87 88 | Popular Tags |