Package java.util

Examples of java.util.Timer.schedule()


   
    // Timer que periodicamente actualizará información referente a la ejecución:
    //
    Timer timer = new Timer();
    timer.schedule(new TimerTask() {
      @Override
      public void run() {
        if (actividad) {
          agentesActivos = Thread.activeCount() - 5;
          actividadLabel.setText(String.format("Agentes en activo x %s", agentesActivos));
View Full Code Here


        try {
            // 启动定时器,用于定时加载cache
            ClientDataReloadTimeTask clientDataReloadTimeTask = new ClientDataReloadTimeTask();
            Timer fileConfigReloadTime = new Timer(true);
            // 指定分钟后首次执行操作,每隔指定时间触发一次
            fileConfigReloadTime.schedule(clientDataReloadTimeTask,
                    RELOAD_MINUTE_CACHE_CLIENTDATA * 60 * 1000, RELOAD_MINUTE_CACHE_CLIENTDATA * 60 * 1000);
        } catch (Exception e) {
        }
  }

View Full Code Here

    // Start the timeout TimerTask, if necessary
    Timer timer = null;
    if (_message.getExecutionTimeout() > 0)
    {
      timer = new Timer(true);
      timer.schedule(new TimeoutCancelTask(_executor, _message, _notificationContext),
                     _message.getExecutionTimeout());
      logger.info("Message starts with timeout " + _message.getExecutionTimeout()
          + " MsgId:" + _message.getMsgId());
    }
    else
View Full Code Here

                result.scheduleAtFixedRate(task, endpoint.getDelay(), endpoint.getPeriod());
            }
        } else {
            if (endpoint.getTime() != null) {
                if (endpoint.getPeriod() >= 0) {
                    result.schedule(task, endpoint.getTime(), endpoint.getPeriod());
                } else {
                    result.schedule(task, endpoint.getTime());
                }
            } else {
                if (endpoint.getPeriod() >= 0) {
View Full Code Here

        } else {
            if (endpoint.getTime() != null) {
                if (endpoint.getPeriod() >= 0) {
                    result.schedule(task, endpoint.getTime(), endpoint.getPeriod());
                } else {
                    result.schedule(task, endpoint.getTime());
                }
            } else {
                if (endpoint.getPeriod() >= 0) {
                    result.schedule(task, endpoint.getDelay(), endpoint.getPeriod());
                } else {
View Full Code Here

                } else {
                    result.schedule(task, endpoint.getTime());
                }
            } else {
                if (endpoint.getPeriod() >= 0) {
                    result.schedule(task, endpoint.getDelay(), endpoint.getPeriod());
                } else {
                    result.schedule(task, endpoint.getDelay());
                }
            }
        }
View Full Code Here

                }
            } else {
                if (endpoint.getPeriod() >= 0) {
                    result.schedule(task, endpoint.getDelay(), endpoint.getPeriod());
                } else {
                    result.schedule(task, endpoint.getDelay());
                }
            }
        }
        return result;
    }
View Full Code Here

   *
   */
  public static Timer haltAM(int status, String text, int delay) {

    Timer timer = new Timer("halt timer", false);
    timer.schedule(new DelayedHalt(status, text), delay);
    return timer;
  }

  public static String propertiesToString(Properties props) {
    TreeSet<String> keys = new TreeSet<String>(props.stringPropertyNames());
View Full Code Here

    rollbackParentContext = false;
        if (timeoutMillis > 0) {
            TimerFactory factory = Monitor.getMonitor().getTimerFactory();
            Timer timer = factory.getCancellationTimer();
            cancelTask = new CancelQueryTask(this);
            timer.schedule(cancelTask, timeoutMillis);
        }
  }

  public void clearInUse() {
    /* We must clear out the current top ResultSet to prepare for
View Full Code Here

                + " milliseconds, "
                + numRetries
                + " retries remaining");

        Timer addFileTimer = new Timer();
        addFileTimer.schedule(new AddAdaptorTask(adaptorName, type, params,
            offset, numRetries - 1, retryInterval), retryInterval);
      }
    } else {
      System.err.println("Giving up on connecting to the local agent");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.