Package org.aksw.commons.util.concurrent
Class ScheduleOnce
java.lang.Object
org.aksw.commons.util.concurrent.ScheduleOnce
Class to schedule a task after a certain delay and ensure that it only
executes once. If there is a request to schedule the task while it is already
running it will be scheduled for the delay.
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScheduleOnce(ScheduledExecutorService scheduledExecutorService, Duration execDelay, Callable<?> task) -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduleOncescheduleOneTaskAtATime(Duration execDelay, Callable<?> task) void
-
Field Details
-
scheduledExecutorService
-
execDelay
-
task
-
lastRequestTime
-
lastExecTime
-
lock
-
-
Constructor Details
-
ScheduleOnce
public ScheduleOnce(ScheduledExecutorService scheduledExecutorService, Duration execDelay, Callable<?> task)
-
-
Method Details
-
scheduleOneTaskAtATime
-
scheduleTask
public void scheduleTask()
-