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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void activate()
      Activates a previously suspended timer.
      String getId()
      The unique identifier of this timer.
      void invoke()
      Invokes the timeout method associated with this timer.
      boolean isActive()
      Indicates whether this timer is active, i.e.
      boolean isCanceled()
      Indicates whether this timer was canceled, i.e.
      boolean isExpired()
      Indicates whether this timer has expired, i.e.
      void suspend()
      Suspends a previously active timer.
      default void validateInvocationContext()
      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 Detail

      • 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.