Class HazelcastTimerStore

    • Method Detail

      • destroyAllTimers

        public void destroyAllTimers​(long applicationId)
        Description copied from class: EJBTimerService
        Destroy all timers associated with a particular application. This is called when an application is undeployed. It expunges all timers whose timed object matches the given application. In the case of an entity bean container, all timers associated with any of that container's entity bean identities will be destroyed. This action *can not* be rolled back.
        Overrides:
        destroyAllTimers in class EJBTimerService
      • destroyTimers

        public void destroyTimers​(long containerId)
        Description copied from class: EJBTimerService
        Destroy all timers associated with a particular ejb container This is typically called when an ejb is undeployed. It expunges all timers whose timed object matches the given container. In the case of an entity bean container, all timers associated with any of that container's entity bean identities will be destroyed. This action *can not* be rolled back.
        Overrides:
        destroyTimers 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.
        Overrides:
        getNextTimeout in class NonPersistentEJBTimerService
        Returns:
        Throws:
        jakarta.ejb.FinderException
      • 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.
        Overrides:
        cancelTimersByKey in class NonPersistentEJBTimerService
      • createSchedules

        public void createSchedules​(long containerId,
                                    long applicationId,
                                    Map<MethodDescriptor,​List<ScheduledTimerDescriptor>> methodDescriptorSchedules,
                                    String server_name)
        Description copied from class: EJBTimerService
        Create automatic timers defined by the @Schedule annotation on the EJB bean during deployment to a cluster or the first create-application-ref call after deployment to DAS only. Only persistent schedule based timers for the containerId that has no timers associated with it, will be created. And no timers will be scheduled.
        Overrides:
        createSchedules in class EJBTimerService
      • createSchedulesOnServer

        public void createSchedulesOnServer​(EjbDescriptor ejbDescriptor,
                                            String server_name)
        Description copied from class: EJBTimerService
        Called in a clustered environment to eagerly create automatic persistent timers on the specific server instance. In a EJB Lite distribution if there is at least one persistent automatic timer defined, this method will fail with a RuntimeException.
        Overrides:
        createSchedulesOnServer in class EJBTimerService
      • expungeTimer

        protected void expungeTimer​(TimerPrimaryKey timerId,
                                    boolean removeTimerBean)
        Description copied from class: EJBTimerService
        Remove all traces of a timer. This should be written defensively so that if expunge is called multiple times for the same timer id, the second, third, fourth, etc. calls will not cause exceptions.
        Overrides:
        expungeTimer in class EJBTimerService
      • getTimerIds

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

        public String[] listTimers​(String[] serverIds)
        Description copied from class: EJBTimerService
        Provide a count of timers owned by each server. Persistence timers are unknown to non-persistent timer service
        Overrides:
        listTimers in class EJBTimerService
      • recoverAndCreateSchedules

        protected Map<TimerPrimaryKey,​Method> recoverAndCreateSchedules​(long containerId,
                                                                              long applicationId,
                                                                              Map<Method,​List<ScheduledTimerDescriptor>> schedules,
                                                                              boolean deploy)
        Description copied from class: EJBTimerService
        Create automatic non-persistent timers defined by the @Schedule annotation on the EJB bean. Recover part is a no-op in this case.
        Overrides:
        recoverAndCreateSchedules in class EJBTimerService
        Returns:
        a Map of created timers, where the key is TimerPrimaryKey and the value is the Method to be executed by the container when the timer with this PK times out.
      • 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
        Overrides:
        resetEJBTimers in class NonPersistentEJBTimerService
      • 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.
        Overrides:
        stopTimers in class NonPersistentEJBTimerService