Module swim.system

Class AgentTimer

    • Method Detail

      • timerContext

        public TimerContext timerContext()
        Description copied from interface: Timer
        Returns the context used to manage this Timer. Returns null if this Timer is not bound to a Schedule.
        Specified by:
        timerContext in interface Timer
      • setTimerContext

        public void setTimerContext​(TimerContext timerContext)
        Description copied from interface: Timer
        Sets the context used to manage this Timer. A TimerContext is assigned when binding this Timer to a Schedule.
        Specified by:
        setTimerContext in interface Timer
      • runTimer

        public void runTimer()
        Description copied from interface: Timer
        Executes scheduled logic when this Timer fires.
        Specified by:
        runTimer in interface Timer
        Specified by:
        runTimer in interface TimerFunction
      • timerWillSchedule

        public void timerWillSchedule​(long millis)
        Description copied from interface: Timer
        Lifecycle callback invoked before this Timer is scheduled for execution.
        Specified by:
        timerWillSchedule in interface Timer
      • timerDidCancel

        public void timerDidCancel()
        Description copied from interface: Timer
        Lifecycle callback invoked after this Timer is explicitly cancelled.
        Specified by:
        timerDidCancel in interface Timer
      • reschedule

        public void reschedule​(long millis)
        Description copied from interface: TimerContext
        Schedules the timer to execute after millis milliseconds has elapsed. If the timer is currently scheduled, it will not ececute at its previously scheduled time; it will only execute at the newly scheduled time.
        Specified by:
        reschedule in interface TimerContext
        Specified by:
        reschedule in interface TimerRef
      • cancel

        public boolean cancel()
        Description copied from interface: TimerContext
        Cancels the timer to prevent it from executing. Returns true if this operation caused the cancellation of the timer; returns false if the timer was not scheduled to execute.
        Specified by:
        cancel in interface TimerContext
        Specified by:
        cancel in interface TimerRef
      • run

        public void run()
        Specified by:
        run in interface Runnable