@Override public void execute(Runnable command) { super.execute(timedRunnable(command)); } };
@Override public ListenableScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return delegate.scheduleAtFixedRate(timedRunnable(command), initialDelay, delay, unit); }
@Override public ListenableScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return delegate.scheduleAtFixedRate(timedRunnable(command), initialDelay, period, unit); }
@Override public <T> ListenableFuture<T> submit(Runnable task, T result) { return super.submit(timedRunnable(task), result); }
@Override public ListenableScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { return delegate.schedule(timedRunnable(command), delay, unit); }
@Override public ListenableFuture<?> submit(Runnable task) { return super.submit(timedRunnable(task)); }
/** * {@inheritDoc} */ @Override public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { return chooseThread().schedule(timedRunnable(command), delay, unit); }
/** * {@inheritDoc} */ @Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return chooseThread().scheduleWithFixedDelay(timedRunnable(command), initialDelay, delay, unit); }
/** * Creates and executes a one-shot action that becomes enabled after the given delay. * * @param command - the SafeRunnable to execute * @param delay - the time from now to delay execution * @param unit - the time unit of the delay parameter * @return a ScheduledFuture representing pending completion of the task and whose get() method * will return null upon completion */ public ScheduledFuture<?> schedule(SafeRunnable command, long delay, TimeUnit unit) { return chooseThread().schedule(timedRunnable(command), delay, unit); }
/** * {@inheritDoc} */ @Override public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return chooseThread().scheduleAtFixedRate(timedRunnable(command), initialDelay, period, unit); }
/** * Creates and executes a periodic action that becomes enabled first after * the given initial delay, and subsequently with the given period. * * <p>For more details check {@link ScheduledExecutorService#scheduleAtFixedRate(Runnable, long, long, TimeUnit)}. * * @param command - the SafeRunnable to execute * @param initialDelay - the time to delay first execution * @param period - the period between successive executions * @param unit - the time unit of the initialDelay and period parameters * @return a ScheduledFuture representing pending completion of the task, and whose get() * method will throw an exception upon cancellation */ public ScheduledFuture<?> scheduleAtFixedRate(SafeRunnable command, long initialDelay, long period, TimeUnit unit) { return chooseThread().scheduleAtFixedRate(timedRunnable(command), initialDelay, period, unit); }
/** * Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently * with the given delay between the termination of one execution and the commencement of the next. * * <p>For more details check {@link ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)} * . * * @param command - the SafeRunnable to execute * @param initialDelay - the time to delay first execution * @param delay - the delay between the termination of one execution and the commencement of the next * @param unit - the time unit of the initialDelay and delay parameters * @return a ScheduledFuture representing pending completion of the task, and whose get() method * will throw an exception upon cancellation */ public ScheduledFuture<?> scheduleWithFixedDelay(SafeRunnable command, long initialDelay, long delay, TimeUnit unit) { return chooseThread().scheduleWithFixedDelay(timedRunnable(command), initialDelay, delay, unit); }