Exemplo n.º 1
0
 private static void exit()
 {
     running = false;
     GatewayCDR _tmp = gateway;
     GatewayCDR.closeAllConnectionInPool();
     System.out.println("Stop.");
     System.exit(0);
 }
Exemplo n.º 2
0
 private void sleep10Minutes() throws InterruptedException {
   /* Ngay sau 00h --> Tao 1 file cuoc moi */
   java.util.Calendar calendar = java.util.Calendar.getInstance();
   calendar.setTime(new java.util.Date(System.currentTimeMillis()));
   int currHour = calendar.get(calendar.HOUR_OF_DAY);
   if ((24 - currHour) * 60 < 2 * FtpData.SCHEDULE_TIME) {
     sleep((FtpData.SCHEDULE_TIME + 1) * 60000); // 00h:01
   } else {
     sleep(FtpData.SCHEDULE_TIME * 60000); // n * minutes;
   }
 }