@Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Inherited public @interface QuartzJob
Job
with simple trigger (QuartzSimpleTrigger
) or cron trigger
QuartzCronTrigger
.
Annotation can be added on method and this method will be called when trigger will be executed.
Every job must have at least one QuartzCronTrigger
or QuartzSimpleTrigger
. And one job can have
one or more QuartzCronTrigger
s and QuartzSimpleTrigger
.
In cluster mode must be set if job will be execute in all nodes (JobExecuteTypeInCluster.CONCURRENT
) or
only in one node (JobExecuteTypeInCluster.NOT_CONCURRENT
) at the same time.
Example:
@QuartzJob
(name = "jobName", group = "groupName", executeTypeInCluster = JobExecuteTypeInCluster.CONCURRENT,
simpleTriggers = @QuartzSimpleTrigger(repeatIntervalMillis = 1000))
public final void invokeJob() throws Exception {
}
This example show that will be create job with group groupName and name jobName and
method invokeJob will be called every 1000 millis in all nodes in cluster.
QuartzSimpleTrigger
,
QuartzCronTrigger
,
JobExecuteTypeInCluster
,
CronTriggerMisfireInstruction
,
SimpleTriggerMisfireInstruction
,
SimpleTriggerPropertyUnit
Modifier and Type | Required Element and Description |
---|---|
JobExecuteTypeInCluster |
executeTypeInCluster
Gets execute type in cluster mode.
|
String |
group
Job group name.
|
String |
name
Job name.
|
Modifier and Type | Optional Element and Description |
---|---|
QuartzCronTrigger[] |
cronTriggers
All cron triggers definition for this job.
|
String |
description
Job description.
|
QuartzSimpleTrigger[] |
simpleTriggers
All simple triggers definition for this job.
|
boolean |
stateful
Uses a Quartz
DisallowConcurrentExecution instead of the default job. |
public abstract String group
public abstract String name
public abstract JobExecuteTypeInCluster executeTypeInCluster
public abstract String description
public abstract boolean stateful
DisallowConcurrentExecution
instead of the default job.true
uses DisallowConcurrentExecution
, false
- otherwisepublic abstract QuartzCronTrigger[] cronTriggers
public abstract QuartzSimpleTrigger[] simpleTriggers
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.