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 javax.ejb.Timer createCalendarTimer​(javax.ejb.ScheduleExpression schedule)
        Specified by:
        createCalendarTimer in interface javax.ejb.TimerService
      • createIntervalTimer

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

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

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

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

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

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

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

        static javax.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: