java任务计划:java任务机来源: 发布时间:星期四, 2009年3月19日 浏览:0次 评论:0
import org.apache.log4j.LogManager; import org.apache.log4j.Logger; public abstract ![]() private ![]() ![]() private Object flag = ![]() ![]() private Object task = null; private String sessionId = null; public void run ![]() while(true){ try{ //等待投放任务 logger.info("ClientRunner waitting..."); synchronized(flag){ flag.wait ![]() } }catch(Exception ex){ logger.error("Interrupted exception. ", ex); } try{ remotCall ![]() saveResult(sessionId); }catch(Exception ex){ logger.error("Remote call exception ", ex); }finally{ task = null; sessionId = null; } |