Interface ManagedTimerService

All Superinterfaces:
org.wildfly.clustering.server.manager.Service, jakarta.ejb.TimerService
All Known Implementing Classes:
CompositeTimerService, DistributableTimerService, NonFunctionalTimerService, TimerServiceImpl

public interface ManagedTimerService extends jakarta.ejb.TimerService, org.wildfly.clustering.server.manager.Service
Interface for managed TimerService implementations.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    default jakarta.ejb.Timer
    createCalendarTimer(jakarta.ejb.ScheduleExpression schedule)
     
    default jakarta.ejb.Timer
    createIntervalTimer(long initialDuration, long intervalDuration, jakarta.ejb.TimerConfig config)
     
    default jakarta.ejb.Timer
    createSingleActionTimer(long duration, jakarta.ejb.TimerConfig config)
     
    default jakarta.ejb.Timer
    createTimer(long initialDuration, long intervalDuration, Serializable info)
     
    default jakarta.ejb.Timer
    createTimer(long duration, Serializable info)
     
    default jakarta.ejb.Timer
    createTimer(Date initialExpiration, long intervalDuration, Serializable info)
     
    default jakarta.ejb.Timer
    createTimer(Date expiration, Serializable info)
     
    Returns the managed timer associated with the specified identifier
    static jakarta.transaction.Transaction
     
    Returns the invoker for the timed object associated with this timer service.
    static boolean
    Returns true if the CurrentInvocationContext represents a lifecycle callback invocation.
    default void
    Validates the invocation context of a given specification method.

    Methods inherited from interface org.wildfly.clustering.server.manager.Service

    start, stop

    Methods inherited from interface jakarta.ejb.TimerService

    createCalendarTimer, createIntervalTimer, createSingleActionTimer, getAllTimers, getTimers
  • Method Details

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