Interface ManagedTimer

All Superinterfaces:
jakarta.ejb.Timer
All Known Implementing Classes:
CalendarTimer, DistributableTimer, OOBTimer, TimerImpl

public interface ManagedTimer extends jakarta.ejb.Timer
Interface for managed Timer implementations.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Activates a previously suspended timer.
    The unique identifier of this timer.
    void
    Invokes the timeout method associated with this timer.
    boolean
    Indicates whether this timer is active, i.e.
    boolean
    Indicates whether this timer was canceled, i.e.
    boolean
    Indicates whether this timer has expired, i.e.
    void
    Suspends a previously active timer.
    default void
    Validates the invocation context of a given specification method.

    Methods inherited from interface jakarta.ejb.Timer

    cancel, getHandle, getInfo, getNextTimeout, getSchedule, getTimeRemaining, isCalendarTimer, isPersistent
  • Method Details

    • getId

      String getId()
      The unique identifier of this timer.
      Returns:
      a unique identifier
    • isActive

      boolean isActive()
      Indicates whether this timer is active, i.e. not suspended.
      Returns:
      true, if this timer is active, false otherwise.
    • isCanceled

      boolean isCanceled()
      Indicates whether this timer was canceled, i.e. via Timer.cancel().
      Returns:
      true, if this timer was canceled, false otherwise.
    • isExpired

      boolean isExpired()
      Indicates whether this timer has expired, i.e. it has no more timeouts. An interval timer will always return false.
      Returns:
      true, if this timer has expired, false otherwise.
    • activate

      void activate()
      Activates a previously suspended timer. Once active, the timer will receive timeout events as usual, including any timeouts missed while inactive.
    • suspend

      void suspend()
      Suspends a previously active timer. While suspended, the timer will not receive timeout events.
    • invoke

      void invoke() throws Exception
      Invokes the timeout method associated with this timer. Has no impact on this timer's schedule.
      Throws:
      Exception
    • validateInvocationContext

      default void validateInvocationContext()
      Validates the invocation context of a given specification method.