2012-03-06 36 views

回答

3

下面的代碼可以在開發模式做了蠻力退出:

@OnApplicationStart 
public class MyCriticalJob extends Job { 
    public void doJob() { 
    if (!ok()) { 
     Logger.fatal("cannot continue due to ...", ...); 
     if (Play.mode.isDev()) { 
     Runtime.getRuntime().halt(-1); 
     } else { 
     Play.stop(); 
     } 
    } 
    } 
}