Fix missing static imports of TimeUnit
This commit is contained in:
@@ -30,9 +30,11 @@ import java.lang.management.ManagementFactory;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
|
||||
public class TimerManager implements TimerManagerMBean {
|
||||
private static final TimerManager instance = new TimerManager();
|
||||
|
||||
@@ -69,7 +71,7 @@ public class TimerManager implements TimerManagerMBean {
|
||||
stpe.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
|
||||
stpe.setRemoveOnCancelPolicy(true);
|
||||
|
||||
stpe.setKeepAliveTime(5, TimeUnit.MINUTES);
|
||||
stpe.setKeepAliveTime(5, MINUTES);
|
||||
stpe.allowCoreThreadTimeOut(true);
|
||||
|
||||
ses = stpe;
|
||||
@@ -87,15 +89,15 @@ public class TimerManager implements TimerManagerMBean {
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> register(Runnable r, long repeatTime, long delay) {
|
||||
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), delay, repeatTime, TimeUnit.MILLISECONDS);
|
||||
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), delay, repeatTime, MILLISECONDS);
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> register(Runnable r, long repeatTime) {
|
||||
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), 0, repeatTime, TimeUnit.MILLISECONDS);
|
||||
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), 0, repeatTime, MILLISECONDS);
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> schedule(Runnable r, long delay) {
|
||||
return ses.schedule(new LoggingSaveRunnable(r), delay, TimeUnit.MILLISECONDS);
|
||||
return ses.schedule(new LoggingSaveRunnable(r), delay, MILLISECONDS);
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> scheduleAtTimestamp(Runnable r, long timestamp) {
|
||||
|
||||
Reference in New Issue
Block a user