Interface Scheduler

  • All Known Implementing Classes:
    SchedulerImpl

    public interface Scheduler
    Schedule a command to run.
    Author:
    Jiri Bubnik
    • Method Detail

      • scheduleCommand

        void scheduleCommand​(Command command)
        Schedule new command for execution.

        If the command (or another same instance by equals) is already scheduled, then the old instance is replaced by this command and timer is restarted.

        The command contains information about target classloader where it should be run.

        The default timeout 100ms is assumed. If another (equals) command is scheduled before the timeout expires, it replaced (or merged). Otherwise the command is executed at timeout.

        Parameters:
        command - the command to execute
      • scheduleCommand

        void scheduleCommand​(Command command,
                             int timeout)
        Schedule new command for execution.

        Parameters:
        command - the command to execute
        timeout - timeout after which the command is executed
      • scheduleCommand

        void scheduleCommand​(Command command,
                             int timeout,
                             Scheduler.DuplicateSheduleBehaviour behaviour)
        Schedule new command for execution.

        Parameters:
        command - the command to execute
        timeout - timeout after which the command is executed
        behaviour - if another instance of this commands runs on schedule or within timeout, should we skip it?
      • run

        void run()
        Run the scheduler agent thread.
      • stop

        void stop()
        Stop the scheduler agent thread.