- java.lang.Object
-
- com.appslandia.common.threading.TaskScheduler<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskScheduler.Task<T>
-
Field Summary
Fields Modifier and Type Field Description protected booleancancelMayInterruptIfRunningprotected ScheduledExecutorServiceexecutorprotected AtomicReference<ScheduledFuture<?>>taskRef
-
Constructor Summary
Constructors Constructor Description TaskScheduler()TaskScheduler(boolean cancelMayInterruptIfRunning)TaskScheduler(boolean cancelMayInterruptIfRunning, ScheduledExecutorService executor)TaskScheduler(boolean cancelMayInterruptIfRunning, ThreadFactory threadFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()booleanhasTask()voidscheduleAtFixedRate(TaskScheduler.Task<T> task, long initialDelay, long period, TimeUnit unit)voidscheduleWithFixedDelay(TaskScheduler.Task<T> task, long initialDelay, long delay, TimeUnit unit)voidshutdownNow()
-
-
-
Field Detail
-
cancelMayInterruptIfRunning
protected final boolean cancelMayInterruptIfRunning
-
executor
protected final ScheduledExecutorService executor
-
taskRef
protected final AtomicReference<ScheduledFuture<?>> taskRef
-
-
Constructor Detail
-
TaskScheduler
public TaskScheduler()
-
TaskScheduler
public TaskScheduler(boolean cancelMayInterruptIfRunning)
-
TaskScheduler
public TaskScheduler(boolean cancelMayInterruptIfRunning, ThreadFactory threadFactory)
-
TaskScheduler
public TaskScheduler(boolean cancelMayInterruptIfRunning, ScheduledExecutorService executor)
-
-
Method Detail
-
scheduleAtFixedRate
public void scheduleAtFixedRate(TaskScheduler.Task<T> task, long initialDelay, long period, TimeUnit unit)
-
scheduleWithFixedDelay
public void scheduleWithFixedDelay(TaskScheduler.Task<T> task, long initialDelay, long delay, TimeUnit unit)
-
cancel
public void cancel()
-
shutdownNow
public void shutdownNow()
-
hasTask
public boolean hasTask()
-
-