001 package railo.runtime.gateway; 002 003 import railo.runtime.gateway.GatewayPro; 004 import railo.runtime.gateway.GatewayEnginePro; 005 006 public class GatewayThread extends Thread { 007 008 public static final int START=0; 009 public static final int STOP=1; 010 public static final int RESTART=2; 011 012 private GatewayEnginePro engine; 013 private GatewayPro gateway; 014 private int action; 015 016 public GatewayThread(GatewayEnginePro engine,GatewayPro gateway,int action){ 017 this.engine=engine; 018 this.gateway=gateway; 019 this.action=action; 020 } 021 022 public void run(){ 023 // MUST handle timout 024 try { 025 if(action==START) gateway.doStart(); 026 else if(action==STOP) gateway.doStop(); 027 else if(action==RESTART) gateway.doRestart(); 028 } 029 catch(Throwable ge){ 030 engine.log(gateway,GatewayEnginePro.LOGLEVEL_ERROR,ge.getMessage()); 031 } 032 } 033 }