Class DefaultScheduler
- java.lang.Object
-
- com.thebuzzmedia.exiftool.core.schedulers.DefaultScheduler
-
- All Implemented Interfaces:
Scheduler
public class DefaultScheduler extends Object implements Scheduler
Default implementation forexiftool
Scheduler
.
This scheduler will execute a task in a specified amount of time:- Time must be specified during construction.
- Time unit (milliseconds, seconds, hours, etc.) may be defined during construction.
-
-
Constructor Summary
Constructors Constructor Description DefaultScheduler(long delay)
Deprecated.UseDefaultScheduler(SchedulerDuration)
instead.DefaultScheduler(long delay, TimeUnit timeUnit)
Deprecated.UseDefaultScheduler(SchedulerDuration)
instead.DefaultScheduler(SchedulerDuration executionDelay)
Create new scheduler.DefaultScheduler(SchedulerDuration executionDelay, SchedulerDuration terminationDelay)
Create new scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
void
shutdown()
Shutdown scheduler: once done, the scheduler will not be usable anymore.void
start(Runnable runnable)
Schedule task.void
stop()
Stop pending task.
-
-
-
Constructor Detail
-
DefaultScheduler
@Deprecated public DefaultScheduler(long delay)
Deprecated.UseDefaultScheduler(SchedulerDuration)
instead.Create new scheduler. Default time unit isTimeUnit.MILLISECONDS
. A default withExecutor will be created.- Parameters:
delay
- Delay.- Throws:
IllegalArgumentException
- Ifdelay
is less than or equal to zero.
-
DefaultScheduler
@Deprecated public DefaultScheduler(long delay, TimeUnit timeUnit)
Deprecated.UseDefaultScheduler(SchedulerDuration)
instead.Create new scheduler. A default withExecutor will be created.- Parameters:
delay
- Delay.timeUnit
- Time Unit.- Throws:
NullPointerException
- IftimeUnit
isnull
.IllegalArgumentException
- Ifdelay
is less than or equal to zero.
-
DefaultScheduler
public DefaultScheduler(SchedulerDuration executionDelay)
Create new scheduler. Default time unit isTimeUnit.MILLISECONDS
. A default withExecutor will be created.- Parameters:
executionDelay
- The delay between execution.- Throws:
IllegalArgumentException
- Ifdelay
is less than or equal to zero.
-
DefaultScheduler
public DefaultScheduler(SchedulerDuration executionDelay, SchedulerDuration terminationDelay)
Create new scheduler. A default withExecutor will be created.- Parameters:
executionDelay
- The delay between scheduler execution.terminationDelay
- The delay to use to wait for termination when scheduler is shutting down.- Throws:
NullPointerException
- IftimeUnit
isnull
.IllegalArgumentException
- Ifdelay
is less than or equal to zero.
-
-
Method Detail
-
start
public void start(Runnable runnable)
Description copied from interface:Scheduler
Schedule task.
Task should not run immediately, instead it should run in a specified amount of time (implementation dependent).
-
stop
public void stop()
Description copied from interface:Scheduler
Stop pending task.
-
shutdown
public void shutdown()
Description copied from interface:Scheduler
Shutdown scheduler: once done, the scheduler will not be usable anymore.
-
-