예제 #1
0
 // 向线程集合中注入线程
 public void startSession(String id, long cspId, String fullFilePath) {
   // 根据线程的id得到该线程对象
   PortalStackFileProcess process = sessions.get(id);
   // 设置线程延时执行的时间
   Integer delaySeconds =
       AppConfigurator.getInstance().getIntConfig("rms.delayWorker.delaySeconds", 2);
   // 如果集合中已存在该线程,则初始化线程的执行时间
   if (process != null) {
     process.setDelaySeconds(delaySeconds);
   } else {
     // 否则,就实例化新的线程,并加入到线程集合中
     process = new PortalStackFileProcess(id, cspId, fullFilePath);
     process.setDelaySeconds(delaySeconds);
     sessions.put(id, process);
   }
 }