Package org.ametys.core.schedule
Class AmetysJob
- java.lang.Object
-
- org.ametys.core.schedule.AmetysJob
-
- All Implemented Interfaces:
Job
@PersistJobDataAfterExecution @DisallowConcurrentExecution public class AmetysJob extends Object implements Job
Ametys implementation of aJobwhich delegates the execution of the task to the rightSchedulable
-
-
Field Summary
Fields Modifier and Type Field Description protected static Context_environmentContextThe cocoon environment context.protected static SchedulableExtensionPoint_schedulableEPThe extension point forSchedulablesprotected static Scheduler_schedulerThe scheduler componentprotected static ServiceManager_serviceManagerThe service managerprotected static UserManager_userManagerThe user manager componentstatic StringKEY_LAST_DURATIONThe key for the last duration of theexecute(org.quartz.JobExecutionContext)method which is stored in theJobDataMapstatic StringKEY_PREVIOUS_FIRE_TIMEThe key for the previous fire time of this job which is stored in theJobDataMapstatic StringKEY_SUCCESSThe key for the success state of the last execution of the job
-
Constructor Summary
Constructors Constructor Description AmetysJob()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean_checkConcurrency(String schedulableId, String runnableId, JobKey currentJobKey, org.slf4j.Logger logger)private boolean_setUserInSession(Map<String,Object> environmentInformation, String userIdentityAsString)static voiddispose()Releases and destroys used resourcesvoidexecute(JobExecutionContext context)static voidinitialize(ServiceManager serviceManager, Context context)Initialize the static fields.
-
-
-
Field Detail
-
KEY_LAST_DURATION
public static final String KEY_LAST_DURATION
The key for the last duration of theexecute(org.quartz.JobExecutionContext)method which is stored in theJobDataMap- See Also:
- Constant Field Values
-
KEY_PREVIOUS_FIRE_TIME
public static final String KEY_PREVIOUS_FIRE_TIME
The key for the previous fire time of this job which is stored in theJobDataMap- See Also:
- Constant Field Values
-
KEY_SUCCESS
public static final String KEY_SUCCESS
The key for the success state of the last execution of the job- See Also:
- Constant Field Values
-
_serviceManager
protected static ServiceManager _serviceManager
The service manager
-
_schedulableEP
protected static SchedulableExtensionPoint _schedulableEP
The extension point forSchedulables
-
_scheduler
protected static Scheduler _scheduler
The scheduler component
-
_environmentContext
protected static Context _environmentContext
The cocoon environment context.
-
_userManager
protected static UserManager _userManager
The user manager component
-
-
Constructor Detail
-
AmetysJob
public AmetysJob()
-
-
Method Detail
-
initialize
public static void initialize(ServiceManager serviceManager, Context context) throws ServiceException, ContextException
Initialize the static fields.- Parameters:
serviceManager- The service managercontext- The context- Throws:
ServiceException- if an error occurs during the lookup of theSchedulableExtensionPointContextException- if environment context object not found
-
dispose
public static void dispose()
Releases and destroys used resources
-
execute
public void execute(JobExecutionContext context) throws JobExecutionException
- Specified by:
executein interfaceJob- Throws:
JobExecutionException
-
_setUserInSession
private boolean _setUserInSession(Map<String,Object> environmentInformation, String userIdentityAsString)
-
_checkConcurrency
private boolean _checkConcurrency(String schedulableId, String runnableId, JobKey currentJobKey, org.slf4j.Logger logger) throws JobExecutionException
- Throws:
JobExecutionException
-
-