Interface ManagedTimerService

    • Method Detail

      • findTimer

        ManagedTimer findTimer​(String id)
        Returns the managed timer associated with the specified identifier
        Parameters:
        id - a timer identifier
        Returns:
        a managed timer
      • getInvoker

        TimedObjectInvoker getInvoker()
        Returns the invoker for the timed object associated with this timer service.
        Returns:
        a timed object invoker
      • createCalendarTimer

        default jakarta.ejb.Timer createCalendarTimer​(jakarta.ejb.ScheduleExpression schedule)
        Specified by:
        createCalendarTimer in interface jakarta.ejb.TimerService
      • createIntervalTimer

        default jakarta.ejb.Timer createIntervalTimer​(long initialDuration,
                                                      long intervalDuration,
                                                      jakarta.ejb.TimerConfig config)
        Specified by:
        createIntervalTimer in interface jakarta.ejb.TimerService
      • createSingleActionTimer

        default jakarta.ejb.Timer createSingleActionTimer​(long duration,
                                                          jakarta.ejb.TimerConfig config)
        Specified by:
        createSingleActionTimer in interface jakarta.ejb.TimerService
      • createTimer

        default jakarta.ejb.Timer createTimer​(long duration,
                                              Serializable info)
                                       throws jakarta.ejb.EJBException
        Specified by:
        createTimer in interface jakarta.ejb.TimerService
        Throws:
        jakarta.ejb.EJBException
      • createTimer

        default jakarta.ejb.Timer createTimer​(long initialDuration,
                                              long intervalDuration,
                                              Serializable info)
        Specified by:
        createTimer in interface jakarta.ejb.TimerService
      • createTimer

        default jakarta.ejb.Timer createTimer​(Date expiration,
                                              Serializable info)
        Specified by:
        createTimer in interface jakarta.ejb.TimerService
      • createTimer

        default jakarta.ejb.Timer createTimer​(Date initialExpiration,
                                              long intervalDuration,
                                              Serializable info)
        Specified by:
        createTimer in interface jakarta.ejb.TimerService
      • validateInvocationContext

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

        static jakarta.transaction.Transaction getActiveTransaction()
        Returns:
        true if the transaction is in a state where synchronizations can be registered
      • isLifecycleCallbackInvocation

        static boolean isLifecycleCallbackInvocation()
        Returns true if the CurrentInvocationContext represents a lifecycle callback invocation. Else returns false.

        This method internally relies on CurrentInvocationContext.get() to obtain the current invocation context.

        • If the context is available then it looks for the method that was invoked. The absence of a method indicates a lifecycle callback.
        • If the context is not available, then this method returns false (i.e. it doesn't consider the current invocation as a lifecycle callback). This is for convenience, to allow the invocation of TimerService methods in the absence of CurrentInvocationContext

        Returns: