Class SchedulerProvider


  • public class SchedulerProvider
    extends Object
    The factory of Scheduler objects. The SchedulerFactory class wraps the actual scheduling backend. It delivers SchedulerFactory instances that are built upon this backend, so that they have the capability to provide instances of the actual scheduler implementation. It is the single entry point to the actual scheduling system for Silverpeas components.
    • Method Detail

      • getVolatileScheduler

        public static Scheduler getVolatileScheduler()
        Gets a volatile scheduler from the underlying scheduling backend. A volatile schedule is a scheduler that stores all the scheduled jobs in memory meaning they will be lost at each runtime restart. Such jobs requires then to be scheduled again. Such scheduler is useful for occasional jobs.
        Returns:
        an instance of the actual scheduler implementation.
      • getPersistentScheduler

        public static Scheduler getPersistentScheduler()
        Gets a persistent scheduler from the underlying scheduling backend. A persistent scheduler is a scheduler that stores all the scheduled jobs and triggers into a persistence context so that they can be retrieved later between different runtime bootstrapping. Such a scheduler is more weighty than the volatile one and requires to be used with case and mainly for very short-time jobs. Warning, in order to be persisted a Job or a SchedulerEventListener requires to be stateless and not anonymous; indeed, only their class name is serialized so that they can be constructed at each job triggering meaning that any change in their execution logic will be then taken into account.
        Returns:
        an instance of the actual implementation of a persistent scheduler.