Interface TimerPersistence

    • Field Detail

      • SERVICE_NAME

        static final org.jboss.msc.service.ServiceName SERVICE_NAME
    • Method Detail

      • addTimer

        void addTimer​(TimerImpl timer)
        Called when a timer is being persisted. In a clustered environment, if an auto timer has already been persisted by another concurrent node, it should not be persisted again, and its state should be set to CANCELED.
        Parameters:
        timer - The timer
      • persistTimer

        void persistTimer​(TimerImpl timer)
        Called when a timer is being persisted
        Parameters:
        timer - The timer
      • shouldRun

        boolean shouldRun​(TimerImpl timer)
        Invoked before running a timer in order to determine if this node should run the timer.
        Parameters:
        timer - The timer
        Returns:
        true if the timer should be run
      • timerDeployed

        default void timerDeployed​(String timedObjectId)
        Signals that the timer is being deployed and any internal structured required should be added.
        Parameters:
        timedObjectId -
      • timerUndeployed

        void timerUndeployed​(String timedObjectId)
        Signals that a timer is being undeployed, and all cached data relating to this object should be dropped to prevent a class loader leak
        Parameters:
        timedObjectId -
      • loadActiveTimers

        List<TimerImpl> loadActiveTimers​(String timedObjectId,
                                         TimerServiceImpl timerService)
        Load all active timers for the given object. If the object is an entity bean timers for all beans will be returned.
        Parameters:
        timedObjectId - The timed object id to load timers for
        Returns:
        A list of all active timers
      • registerChangeListener

        Closeable registerChangeListener​(String timedObjectId,
                                         TimerPersistence.TimerChangeListener listener)
        Registers a listener to listed for new timers that are added to the database.
        Parameters:
        timedObjectId - The timed object
        listener - The listener
        Returns:
        A Closable that can be used to unregister the listener