/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) { if (callable == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(callable, new ScheduledFutureTask(callable, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) { if (callable == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(callable, new ScheduledFutureTask(callable, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) { if (callable == null || unit == null) throw new NullPointerException(); if (delay < 0) delay = 0; long triggerTime = now() + unit.toNanos(delay); RunnableScheduledFuture t = decorateTask(callable, new ScheduledFutureTask(callable, triggerTime)); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (period <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(period))); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (period <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(period))); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(-delay))); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(-delay))); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (delay <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(-delay))); delayedExecute(t); return t; }
/** * @throws RejectedExecutionException {@inheritDoc} * @throws NullPointerException {@inheritDoc} * @throws IllegalArgumentException {@inheritDoc} */ public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { if (command == null || unit == null) throw new NullPointerException(); if (period <= 0) throw new IllegalArgumentException(); if (initialDelay < 0) initialDelay = 0; long triggerTime = now() + unit.toNanos(initialDelay); RunnableScheduledFuture t = decorateTask(command, new ScheduledFutureTask(command, null, triggerTime, unit.toNanos(period))); delayedExecute(t); return t; }