Class VolatileQuartScheduler

  • All Implemented Interfaces:
    Initialization, Scheduler

    @Default
    @Service
    @Singleton
    public class VolatileQuartScheduler
    extends QuartzScheduler
    A volatile scheduler implementation using Quartz as scheduling backend. It wraps a Quartz scheduler and delegates to it all of the calls after transforming the parameters into their Quartz counterparts. The Quartz scheduler is configured to use a RAM Job store to store all the scheduled jobs. Those jobs will be lost after a scheduler shutdown and they will require to be scheduled again at the scheduler starting.
    • Constructor Detail

      • VolatileQuartScheduler

        protected VolatileQuartScheduler()
        Constructs a new volatile scheduler.
    • Method Detail

      • init

        public void init()
        Description copied from interface: Initialization
        Initializes some resources required by the services or performs some initialization processes at Silverpeas startup.
      • release

        public void release()
                     throws Exception
        Description copied from interface: Initialization
        Releases the previously initialized resources at Silverpeas shutdown. The implementation of this method is optional. By default it does nothing.
        Throws:
        Exception - if an error occurs during the shutdown process. In this case, a log will be outputed and the shutdown goes one.
      • encodeJob

        protected Job encodeJob​(Job job)
        Description copied from class: QuartzScheduler
        Encodes the specified job into an object ready to be handled by the job executor related to this scheduler. Each type of scheduler has its own way to encode a job in order to be retrieved by the job executor related by the scheduler.
        Specified by:
        encodeJob in class QuartzScheduler
        Parameters:
        job - the job to encode for the job executor related to this scheduler.
        Returns:
        the encoded job.
      • encodeEventListener

        protected SchedulerEventListener encodeEventListener​(SchedulerEventListener listener)
        Description copied from class: QuartzScheduler
        Encodes the specified scheduler event listener into an object ready to be handled by the job executor related to this scheduler. Each type of scheduler has its own way to encode an event listener in order to be retrieved by the job executor related by the scheduler.
        Specified by:
        encodeEventListener in class QuartzScheduler
        Parameters:
        listener - the event listener to encode for the job executor related to this scheduler.
        Returns:
        the encoded scheduler event listener.
      • execute

        protected <T> void execute​(QuartzScheduler.SchedulingTask<T> schedulingTask)
                            throws org.quartz.SchedulerException
        Description copied from class: QuartzScheduler
        Executes the specified task. The execution of the task is delegated to this method that can wraps the task execution within a peculiar execution context like a transaction for example for persistent jobs.
        Specified by:
        execute in class QuartzScheduler
        Parameters:
        schedulingTask - the scheduling task to execute.
        Throws:
        org.quartz.SchedulerException