Ejemplo n.º 1
0
  @Override
  public void scheduleWithFixedDelay(Runnable task, long initialDelay, long recurringDelay) {
    ArgumentVerifier.assertNotNull(task, "task");
    ArgumentVerifier.assertNotNegative(initialDelay, "initialDelay");
    ArgumentVerifier.assertNotNegative(recurringDelay, "recurringDelay");

    RecurringDelayTask taskWrapper = new RecurringDelayTask(task, initialDelay, recurringDelay);
    addScheduled(taskWrapper);
  }
Ejemplo n.º 2
0
  @Override
  public void scheduleAtFixedRate(Runnable task, long initialDelay, long period) {
    ArgumentVerifier.assertNotNull(task, "task");
    ArgumentVerifier.assertNotNegative(initialDelay, "initialDelay");
    ArgumentVerifier.assertGreaterThanZero(period, "period");

    RecurringRateTask taskWrapper = new RecurringRateTask(task, initialDelay, period);
    addScheduled(taskWrapper);
  }