Package com.avoka.fc.core.job
Class AbstractJob
- java.lang.Object
-
- com.avoka.fc.core.job.AbstractJob
-
-
Field Summary
Fields Modifier and Type Field Description static StringJOB_CONTEXT_PARAMThe Job execution context data map paramter name.static StringJOB_GROUP_BACKGROUNDThe job group for background jobs that are not to be managed in the management consolestatic StringJOB_GROUP_MEMORYThe job group for in memory jobs that are not to be managed in the management consoleprotected booleanlogExecutionLog the job execution.protected static ListMANAGER_LISTENERSstatic StringSERVLET_CONTEXTThe scheduler context path for the application servlet context.static StringSPRING_CONTEXTThe schedulder context path for the application servlet context.
-
Constructor Summary
Constructors Constructor Description AbstractJob()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecute(org.quartz.JobExecutionContext context)Called by the Scheduler when a Trigger fires that is associated with the Job.abstract voidexecuteJob()Subclasses should override this method to provide their functionality.org.quartz.JobExecutionContextgetContext()Return the Quartz JobExecutionContext.StringgetContextParam()Return the "JobContextParam" value configured for the Scheduled Job.org.apache.cayenne.access.DataContextgetDataContext()Return the thread local DataContext.ErrorLogServicegetErrorLogService()org.slf4j.LoggergetLogger()Return the object logger.ServletContextgetServletContext()Return the application servlet context.voidinterrupt()Called by the Scheduler when a user interrupts the job.booleanisInterrupted()Return true if the job has been manually stopped.ErrorLoglogException(Throwable error)Log the exception to the ErrorLog if an error occurs performing the job.
-
-
-
Field Detail
-
SPRING_CONTEXT
public static final String SPRING_CONTEXT
The schedulder context path for the application servlet context.- See Also:
- Constant Field Values
-
SERVLET_CONTEXT
public static final String SERVLET_CONTEXT
The scheduler context path for the application servlet context.- See Also:
- Constant Field Values
-
JOB_CONTEXT_PARAM
public static final String JOB_CONTEXT_PARAM
The Job execution context data map paramter name.- See Also:
- Constant Field Values
-
JOB_GROUP_BACKGROUND
public static final String JOB_GROUP_BACKGROUND
The job group for background jobs that are not to be managed in the management console- See Also:
- Constant Field Values
-
JOB_GROUP_MEMORY
public static final String JOB_GROUP_MEMORY
The job group for in memory jobs that are not to be managed in the management console- See Also:
- Constant Field Values
-
MANAGER_LISTENERS
protected static final List MANAGER_LISTENERS
-
logExecution
protected boolean logExecution
Log the job execution.
-
-
Method Detail
-
executeJob
public abstract void executeJob()
Subclasses should override this method to provide their functionality. A DataContext object will be bound to the thread executing this task. Any uncommitted changes to the DataContext will be automatically rolled back when this method completes.
-
getContext
public org.quartz.JobExecutionContext getContext()
Return the Quartz JobExecutionContext.- Returns:
- the Quartz JobExecutionContext
-
getContextParam
public String getContextParam()
Return the "JobContextParam" value configured for the Scheduled Job.- Returns:
- the "JobContextParam" value configured for the Scheduled Job.
-
getDataContext
public org.apache.cayenne.access.DataContext getDataContext()
Return the thread local DataContext.- Returns:
- the thread local DataContext
-
isInterrupted
public boolean isInterrupted()
Return true if the job has been manually stopped.- Returns:
- true if the job has been manually stopped
-
interrupt
public void interrupt() throws org.quartz.UnableToInterruptJobExceptionCalled by the Scheduler when a user interrupts the job.- Specified by:
interruptin interfaceorg.quartz.InterruptableJob- Throws:
org.quartz.UnableToInterruptJobException- if there is an exception while interrupting the job.- See Also:
InterruptableJob.interrupt()
-
getErrorLogService
public ErrorLogService getErrorLogService()
- Returns:
- the error log service.
- Since:
- 4.3.4
-
getLogger
public org.slf4j.Logger getLogger()
Return the object logger.- Returns:
- the object logger
-
getServletContext
public ServletContext getServletContext()
Return the application servlet context.- Returns:
- the application servlet context
-
execute
public final void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionExceptionCalled by the Scheduler when a Trigger fires that is associated with the Job.- Specified by:
executein interfaceorg.quartz.Job- Parameters:
context- the job execute context- Throws:
org.quartz.JobExecutionException- if there is an exception while executing the job.- See Also:
Job.execute(JobExecutionContext)
-
-