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 String
the 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 TypeMethodDescriptionvoid
Calculate how long before the next runtime.int
void
execute
(org.quartz.JobExecutionContext context) org.quartz.JobDetail
int
getJobId()
Get the value of jobId.org.quartz.Trigger
Get the next runtime for this job as a String.Gets the next runtime as a datelong
Get the next runtime for this job as a long.getTask()
Get the value of task.boolean
isActive()
Check to see if job is currently active/runningboolean
isNew()
Return true, if the entry is not yet persistedvoid
setActive
(boolean isActive) Sets whether the job is running.void
setJobId
(int v) Set the value of jobId.void
setJobTrigger
(org.quartz.Trigger jobTrigger) void
Set 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:
compareTo
in interfaceComparable<JobEntry>
- See Also:
-
setActive
Description copied from interface:JobEntry
Sets whether the job is running. -
isActive
Description copied from interface:JobEntry
Check to see if job is currently active/running -
getNextRuntime
Description copied from interface:JobEntry
Get the next runtime for this job as a long.- Specified by:
getNextRuntime
in interfaceJobEntry
- Returns:
- The next run time as a long.
- See Also:
-
getNextRunDate
Description copied from interface:JobEntry
Gets the next runtime as a date- Specified by:
getNextRunDate
in interfaceJobEntry
- Returns:
- Next run date
- See Also:
-
getNextRunAsString
Description copied from interface:JobEntry
Get the next runtime for this job as a String.- Specified by:
getNextRunAsString
in interfaceJobEntry
- Returns:
- The next run time as a String.
- See Also:
-
calcRunTime
Description copied from interface:JobEntry
Calculate 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:
calcRunTime
in interfaceJobEntry
- Throws:
TurbineException
- a generic exception.- See Also:
-
execute
- Specified by:
execute
in interfaceorg.quartz.Job
- Throws:
org.quartz.JobExecutionException
- See Also:
-