Package org.alfresco.schedule
Class AbstractScheduledLockedJob
- java.lang.Object
-
- org.springframework.scheduling.quartz.QuartzJobBean
-
- org.alfresco.schedule.AbstractScheduledLockedJob
-
- All Implemented Interfaces:
org.quartz.Job
public abstract class AbstractScheduledLockedJob extends org.springframework.scheduling.quartz.QuartzJobBeanThis class should be extended any time a scheduled job needs to be implemented to be executed usingJobLockService. It makes the cluster aware locking of the job transparent to the implementation. On the job's springJobExecutionContextit will still always have to be passed as parameter thejobLockService. The name to be used for locking of the job is optional, if none is passed a name will be composed using the simple name of the implementation class. In general if it may make sense to have more than one job setup using the same class you should always use a different name on eachJobExecutionContextto differentiate the jobs, unless you want the lock to be shared between the different instances. The only method to be implemented when extending this class isexecuteJob(JobExecutionContext).- Since:
- 4.1.5
- Author:
- Rui Fernandes
-
-
Constructor Summary
Constructors Constructor Description AbstractScheduledLockedJob()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidexecuteInternal(org.quartz.JobExecutionContext jobContext)abstract voidexecuteJob(org.quartz.JobExecutionContext jobContext)This is the method that should be implemented by any extension of the abstract class.
-
-
-
Method Detail
-
executeInternal
protected final void executeInternal(org.quartz.JobExecutionContext jobContext) throws org.quartz.JobExecutionException- Specified by:
executeInternalin classorg.springframework.scheduling.quartz.QuartzJobBean- Throws:
org.quartz.JobExecutionException
-
executeJob
public abstract void executeJob(org.quartz.JobExecutionContext jobContext) throws org.quartz.JobExecutionExceptionThis is the method that should be implemented by any extension of the abstract class. It won't need to worry about any lockings of the job and can focus only on its specific task.- Parameters:
jobContext- context of the execution for retrieving services, etc- Throws:
org.quartz.JobExecutionException- if a job fails to execute
-
-