Class NonPersistentEJBTimerService

    • Constructor Detail

      • NonPersistentEJBTimerService

        protected NonPersistentEJBTimerService()
                                        throws Exception
        Throws:
        Exception
    • Method Detail

      • isNonpersistent

        protected boolean isNonpersistent​(TimerPrimaryKey timerId)
                                   throws jakarta.ejb.FinderException
        Check if timerId represents nonpersistent timer. Used by subclasses to determine whether this class would handle the actions on this timer.
        Parameters:
        timerId - id of the timer
        Returns:
        true if timerId represents valid active timer
        Throws:
        jakarta.ejb.FinderException - if timerId represents expired nonpersistent timer
      • cancelTimersByKey

        protected void cancelTimersByKey​(long containerId,
                                         Object primaryKey)
        Description copied from class: EJBTimerService
        Cancel all timers associated with a particular entity bean identity.This is typically called when an entity bean is removed.Note that this action falls under the normal EJB Timer removal semantics, which means it can be rolled back if the transaction rolls back.
        Specified by:
        cancelTimersByKey in class EJBTimerService
      • getNextTimeout

        protected Date getNextTimeout​(TimerPrimaryKey timerId)
                               throws jakarta.ejb.FinderException
        Description copied from class: EJBTimerService
        Return next planned timeout for this timer.We have a fair amount of leeway regarding the consistency of this information.We should strive to detect the case where the timer no longer exists.However, since the current timer instance may not even own this timer, it's difficult to know the exact time of delivery in another server instance. In the case of single-action timers, we return the expiration time that was provided upon timer creation. For periodic timers, we can derive the next scheduled fixed rate expiration based on the initial expiration and the interval.
        Specified by:
        getNextTimeout in class EJBTimerService
        Returns:
        Throws:
        jakarta.ejb.FinderException
      • cancelNonPersistentTimer

        protected boolean cancelNonPersistentTimer​(TimerPrimaryKey timerId)
                                            throws jakarta.ejb.FinderException,
                                                   Exception
        Throws:
        jakarta.ejb.FinderException
        Exception
      • getNonPersistentTimer

        protected RuntimeTimerState getNonPersistentTimer​(TimerPrimaryKey timerId)
                                                   throws jakarta.ejb.FinderException
        Throws:
        jakarta.ejb.FinderException
      • getTimerIds

        protected Collection<TimerPrimaryKey> getTimerIds​(long containerId,
                                                          Object timedObjectPrimaryKey)
        Description copied from class: EJBTimerService
        Called by EJBTimerServiceWrapper when caller calls getTimers.
        Specified by:
        getTimerIds in class EJBTimerService
        Parameters:
        containerId - the id of the EJB which owns the timers
        timedObjectPrimaryKey - can be null if not entity bean
        Returns:
        Collection of Timer Ids.
      • stopTimers

        protected void stopTimers​(long containerId)
        Description copied from class: EJBTimerService
        Remove from the cache and stop all timers associated with a particular ejb container and known to this server instance.This is typically called when an ejb is disabled or on a server shutdown to avoid accidentally removing a valid timer. This is also called when an ejb is disabled as part of an undeploy. Removal of the associated timer from the database is done as the last step of undeployment.
        Specified by:
        stopTimers in class EJBTimerService
      • resetEJBTimers

        protected void resetEJBTimers​(String target)
        Description copied from class: EJBTimerService
        Called at server startup *after* user apps have been re-activated to restart any active EJB timers or cleanup old timers.No-op for non-persistent timers
        Specified by:
        resetEJBTimers in class EJBTimerService