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 aJob
which delegates the execution of the task to the rightSchedulable
-
-
Field Summary
Fields Modifier and Type Field Description protected static Context
_environmentContext
The cocoon environment context.protected static SchedulableExtensionPoint
_schedulableEP
The extension point forSchedulable
sprotected static Scheduler
_scheduler
The scheduler componentprotected static ServiceManager
_serviceManager
The service managerprotected static UserManager
_userManager
The user manager componentstatic String
KEY_LAST_DURATION
The key for the last duration of theexecute(org.quartz.JobExecutionContext)
method which is stored in theJobDataMap
static String
KEY_PREVIOUS_FIRE_TIME
The key for the previous fire time of this job which is stored in theJobDataMap
static String
KEY_SUCCESS
The 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 void
dispose()
Releases and destroys used resourcesvoid
execute(JobExecutionContext context)
static void
initialize(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 forSchedulable
s
-
_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 theSchedulableExtensionPoint
ContextException
- 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:
execute
in 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
-
-