Class VolatileQuartScheduler
- java.lang.Object
-
- org.silverpeas.core.scheduler.quartz.QuartzScheduler
-
- org.silverpeas.core.scheduler.quartz.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVolatileQuartScheduler.VolatileJobExecutor-
Nested classes/interfaces inherited from class org.silverpeas.core.scheduler.quartz.QuartzScheduler
QuartzScheduler.SchedulingTask<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVolatileQuartScheduler()Constructs a new volatile scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SchedulerEventListenerencodeEventListener(SchedulerEventListener listener)Encodes the specified scheduler event listener into an object ready to be handled by the job executor related to this scheduler.protected JobencodeJob(Job job)Encodes the specified job into an object ready to be handled by the job executor related to this scheduler.protected <T> voidexecute(QuartzScheduler.SchedulingTask<T> schedulingTask)Executes the specified task.protected Class<VolatileQuartScheduler.VolatileJobExecutor>getJobExecutor()Gets the job executor related to this scheduler.voidinit()Initializes some resources required by the services or performs some initialization processes at Silverpeas startup.voidrelease()Releases the previously initialized resources at Silverpeas shutdown.-
Methods inherited from class org.silverpeas.core.scheduler.quartz.QuartzScheduler
getPriority, getScheduledJob, isJobScheduled, scheduleJob, scheduleJob, scheduleJob, shutdown, unscheduleJob
-
-
-
-
Method Detail
-
init
public void init()
Description copied from interface:InitializationInitializes some resources required by the services or performs some initialization processes at Silverpeas startup.
-
release
public void release() throws ExceptionDescription copied from interface:InitializationReleases 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:QuartzSchedulerEncodes 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:
encodeJobin classQuartzScheduler- 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:QuartzSchedulerEncodes 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:
encodeEventListenerin classQuartzScheduler- Parameters:
listener- the event listener to encode for the job executor related to this scheduler.- Returns:
- the encoded scheduler event listener.
-
getJobExecutor
protected Class<VolatileQuartScheduler.VolatileJobExecutor> getJobExecutor()
Description copied from class:QuartzSchedulerGets the job executor related to this scheduler. Each type of scheduler has its own job executor that knows how to handle jobs and event listeners.- Specified by:
getJobExecutorin classQuartzScheduler- Returns:
- the class of the job executor.
-
execute
protected <T> void execute(QuartzScheduler.SchedulingTask<T> schedulingTask) throws org.quartz.SchedulerException
Description copied from class:QuartzSchedulerExecutes 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:
executein classQuartzScheduler- Parameters:
schedulingTask- the scheduling task to execute.- Throws:
org.quartz.SchedulerException
-
-