package io.micronaut.scheduling.instrument;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.concurrent.Callable;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
public interface InstrumentedScheduledExecutorService extends InstrumentedExecutorService, ScheduledExecutorService {
@Override
ScheduledExecutorService getTarget();
@Override
default ScheduledFuture<?> schedule(@NonNull Runnable command, long delay, @NonNull TimeUnit unit) {
return getTarget().schedule(instrument(command), delay, unit);
}
@Override
default <V> ScheduledFuture<V> schedule(@NonNull Callable<V> callable, long delay, @NonNull TimeUnit unit) {
return getTarget().schedule(instrument(callable), delay, unit);
}
@Override
default ScheduledFuture<?> scheduleAtFixedRate(@NonNull Runnable command, long initialDelay, long period, @NonNull TimeUnit unit) {
return getTarget().scheduleAtFixedRate(instrument(command), initialDelay, period, unit);
}
@Override
default ScheduledFuture<?> scheduleWithFixedDelay(@NonNull Runnable command, long initialDelay, long delay, @NonNull TimeUnit unit) {
return getTarget().scheduleWithFixedDelay(instrument(command), initialDelay, delay, unit);
}
}