Class JobEntryQuartz
java.lang.Object
org.apache.turbine.services.schedule.JobEntryQuartz
- All Implemented Interfaces:
Comparable<JobEntry>,JobEntry,org.quartz.Job
This implements a Turbine scheduled job model for the
QuartzScheduler.- Author:
- Thomas Vandahl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe default Quartz schedule group name for Turbine jobs -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorJobEntryQuartz(org.quartz.Trigger jobTrigger) ConstructorJobEntryQuartz(org.quartz.Trigger jobTrigger, org.quartz.JobDetail jobDetail) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidCalculate how long before the next runtime.intvoidexecute(org.quartz.JobExecutionContext context) org.quartz.JobDetailintgetJobId()Get the value of jobId.org.quartz.TriggerGet the next runtime for this job as a String.Gets the next runtime as a datelongGet the next runtime for this job as a long.getTask()Get the value of task.booleanisActive()Check to see if job is currently active/runningbooleanisNew()Return true, if the entry is not yet persistedvoidsetActive(boolean isActive) Sets whether the job is running.voidsetJobId(int v) Set the value of jobId.voidsetJobTrigger(org.quartz.Trigger jobTrigger) voidSet the value of task.
-
Field Details
-
DEFAULT_JOB_GROUP_NAME
the default Quartz schedule group name for Turbine jobs- See Also:
-
-
Constructor Details
-
JobEntryQuartz
public JobEntryQuartz()Default constructor -
JobEntryQuartz
Constructor- Parameters:
jobTrigger- Job time table
-
JobEntryQuartz
Constructor- Parameters:
jobTrigger- Job time tablejobDetail- job details
-
-
Method Details
-
isNew
Return true, if the entry is not yet persisted -
getJobId
Get the value of jobId. -
setJobId
Set the value of jobId. -
getTask
Get the value of task. -
setTask
Set the value of task. -
getJobTrigger
- Returns:
- the jobTrigger
-
setJobTrigger
- Parameters:
jobTrigger- the jobTrigger to set
-
getJobDetail
- Returns:
- the jobDetail
-
compareTo
- Specified by:
compareToin interfaceComparable<JobEntry>- See Also:
-
setActive
Description copied from interface:JobEntrySets whether the job is running. -
isActive
Description copied from interface:JobEntryCheck to see if job is currently active/running -
getNextRuntime
Description copied from interface:JobEntryGet the next runtime for this job as a long.- Specified by:
getNextRuntimein interfaceJobEntry- Returns:
- The next run time as a long.
- See Also:
-
getNextRunDate
Description copied from interface:JobEntryGets the next runtime as a date- Specified by:
getNextRunDatein interfaceJobEntry- Returns:
- Next run date
- See Also:
-
getNextRunAsString
Description copied from interface:JobEntryGet the next runtime for this job as a String.- Specified by:
getNextRunAsStringin interfaceJobEntry- Returns:
- The next run time as a String.
- See Also:
-
calcRunTime
Description copied from interface:JobEntryCalculate how long before the next runtime.
The runtime determines it's position in the job queue. Here's the logic:
1. Create a date the represents when this job is to run.
2. If this date has expired, them "roll" appropriate date fields forward to the next date.
3. Calculate the diff in time between the current time and the next run time.- Specified by:
calcRunTimein interfaceJobEntry- Throws:
TurbineException- a generic exception.- See Also:
-
execute
- Specified by:
executein interfaceorg.quartz.Job- Throws:
org.quartz.JobExecutionException- See Also:
-