Class Components.Timer

java.lang.Object
org.jgrapes.core.Components.Timer
Enclosing class:
Components

public static class Components.Timer extends Object
Represents a timer as created by Components.schedule(TimeoutHandler, Instant).
  • Method Details

    • reschedule

      public void reschedule(Instant scheduledFor)
      Reschedules the timer for the given instant.
      Parameters:
      scheduledFor - the instant
    • reschedule

      public void reschedule(Duration scheduledFor)
      Reschedules the timer for the given duration after now.
      Parameters:
      scheduledFor - the timeout
    • timeoutHandler

      Returns the timeout handler of this timer.
      Returns:
      the handler
    • scheduledFor

      Returns the instant that this handler is scheduled for.
      Returns:
      the instant or null if the timer has been cancelled.
    • cancel

      public void cancel()
      Cancels this timer.