@Override public ScheduledFuture<?> schedule(final Runnable command, final TimeValue timeValue) throws RejectedExecutionException { Args.notNull(command, "Runnable"); Args.notNull(timeValue, "Time value"); return executorService.schedule(command, timeValue.getDuration(), timeValue.getTimeUnit()); }
private TimeUnit min(final TimeUnit other) { return scale() > scale(other) ? other : getTimeUnit(); }
private TimeUnit min(final TimeUnit other) { return scale() > scale(other) ? other : getTimeUnit(); }
@Override public ScheduledFuture<?> schedule(final Runnable command, final TimeValue timeValue) throws RejectedExecutionException { Args.notNull(command, "Runnable"); Args.notNull(timeValue, "Time value"); return executorService.schedule(command, timeValue.getDuration(), timeValue.getTimeUnit()); }
private boolean isGreaterThan(final TimeValue other) { final TimeUnit targetTimeUnit = min(other.getTimeUnit()); return convert(targetTimeUnit) > other.convert(targetTimeUnit); }
private boolean isGreaterThan(final TimeValue other) { final TimeUnit targetTimeUnit = min(other.getTimeUnit()); return convert(targetTimeUnit) > other.convert(targetTimeUnit); }
public void awaitTermination(final TimeValue waitTime) throws InterruptedException { Args.notNull(waitTime, "Wait time"); this.workerExecutorService.awaitTermination(waitTime.getDuration(), waitTime.getTimeUnit()); }
public void awaitTermination(final TimeValue waitTime) throws InterruptedException { Args.notNull(waitTime, "Wait time"); this.workerExecutorService.awaitTermination(waitTime.getDuration(), waitTime.getTimeUnit()); }
private void testFactory(final TimeUnit timeUnit) { Assert.assertEquals(timeUnit, TimeValue.of(1, timeUnit).getTimeUnit()); }