From e20a2269ae61b3e3fe4902efa9d3a5e576bc14a9 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 20 Apr 2022 18:34:33 +1200 Subject: [PATCH] Remove deprecated methods from BackgroundExecutor, migrate executePeriodically() -> scheduleWithFixedDelay() All removed methods are renamed. Migrate to use the renamed method. --- .../java/io/ebean/BackgroundExecutor.java | 20 ------------------- .../executor/DefaultBackgroundExecutor.java | 11 ---------- 2 files changed, 31 deletions(-) diff --git a/ebean-api/src/main/java/io/ebean/BackgroundExecutor.java b/ebean-api/src/main/java/io/ebean/BackgroundExecutor.java index f553933db..4941f2058 100644 --- a/ebean-api/src/main/java/io/ebean/BackgroundExecutor.java +++ b/ebean-api/src/main/java/io/ebean/BackgroundExecutor.java @@ -39,26 +39,6 @@ public interface BackgroundExecutor { */ void execute(Runnable task); - /** - * Deprecated - migrate to scheduleWithFixedDelay(). - * Execute a task periodically with a fixed delay between each execution. - *

- * For example, execute a runnable every minute. - *

- * The delay is the time between executions no matter how long the task took. - * That is, this method has the same behaviour characteristics as - * {@link ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)} - */ - @Deprecated - void executePeriodically(Runnable task, long delay, TimeUnit unit); - - /** - * Deprecated - migrate to scheduleWithFixedDelay(). - * Execute a task periodically additionally with an initial delay different from delay. - */ - @Deprecated - void executePeriodically(Runnable task, long initialDelay, long delay, TimeUnit unit); - /** * Execute a task periodically with a given delay. * diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/executor/DefaultBackgroundExecutor.java b/ebean-core/src/main/java/io/ebeaninternal/server/executor/DefaultBackgroundExecutor.java index 6e49ff255..b4c13a8bd 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/executor/DefaultBackgroundExecutor.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/executor/DefaultBackgroundExecutor.java @@ -100,22 +100,11 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor { return pool.submit(wrap(task)); } - @Override public void execute(Runnable task) { submit(logExceptions(task)); } - @Override - public void executePeriodically(Runnable task, long delay, TimeUnit unit) { - schedulePool.scheduleWithFixedDelay(wrap(logExceptions(task)), delay, delay, unit); - } - - @Override - public void executePeriodically(Runnable task, long initialDelay, long delay, TimeUnit unit) { - schedulePool.scheduleWithFixedDelay(wrap(logExceptions(task)), initialDelay, delay, unit); - } - @Override public ScheduledFuture scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) { return schedulePool.scheduleWithFixedDelay(wrap(logExceptions(task)), initialDelay, delay, unit);