62,614
社区成员
发帖
与我相关
我的任务
分享
public class ProtectThread extends Thread{
private static final Log log = LogFactory.getLog(ProtectThread.class);
private List<MyTimer> t = new ArrayList<MyTimer>();
@Override
public void run() {
MyTimer t1 = new MyTimer("refreshCache,refreshMongP,refreshMongG,refreshMongC,recStat,ConStat",new Date(),1000*60);
t.add(t1);
while(true){
try {
//new DataSupport().doSendBulk();
Thread.sleep(1000);
System.out.println("1");
} catch (Exception e) {
log.error(e);
}
}
}
public void thisStop(){
for (int i = 0 ; i< t.size() ; i++){
t.get(i).stop();
}
this.interrupt();
}
}
public static ProtectThread thread = new ProtectThread();
public static void main(String[] args) throws Exception {
thread.start();
}
现在我把这个程序打包成jar文件后在cmd中启动,无法停止,你们说的设定flag值已经试过无用!!!!!!!!!!!!!!!!!!!!!