Class DefaultScheduler

  • All Implemented Interfaces:
    Scheduler

    public class DefaultScheduler
    extends Object
    implements Scheduler
    Default implementation for exiftool 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.
    Note: This scheduler will stop pending task when instance is garbage collected. This is just a small security but we cannot guarantee when instance will be garbage collected. For this reason, it should be up to the caller to stop this scheduler when it is not needed anymore.
    • 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).
        Specified by:
        start in interface Scheduler
        Parameters:
        runnable - Task to run.
      • stop

        public void stop()
        Description copied from interface: Scheduler
        Stop pending task.
        Specified by:
        stop in interface Scheduler
      • shutdown

        public void shutdown()
        Description copied from interface: Scheduler
        Shutdown scheduler: once done, the scheduler will not be usable anymore.
        Specified by:
        shutdown in interface Scheduler