Task.java 1013 Bytes
Newer Older
Yazawazi's avatar
Yazawazi committed
1
2
package emu.grasscutter.task;

Yazawazi's avatar
Yazawazi committed
3
4
import org.quartz.JobDataMap;

Yazawazi's avatar
Yazawazi committed
5
6
7
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

Yazawazi's avatar
Yazawazi committed
8
9
10

/*
* So what is cron expression?
Yazawazi's avatar
Yazawazi committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
The format of a Cron expression is as follows.
Second Minute Hour Day Month Week Year
Seconds: 0-59
Minute: 0-59
hour: 0-23
Day: 1-31
Month: 1-12
Week: 1-7 (0-6 sometimes)
Year: Specify your own

If you want to express every second or every minute or something like that, use the * symbol in that position;
if you want to express more than one such as every 15 minutes and every 30 minutes, you can write:`15, 30`.

For the rest of the wildcard characters, please Google them yourself
Yazawazi's avatar
Yazawazi committed
25
*/
Yazawazi's avatar
Yazawazi committed
26

Yazawazi's avatar
Yazawazi committed
27
28
29
30
31
@Retention(RetentionPolicy.RUNTIME)
public @interface Task {
    String taskName() default "NO_NAME";
    String taskCronExpression() default "0 0 0 0 0 ?";
    String triggerName() default "NO_NAME";
Yazawazi's avatar
Yazawazi committed
32
33
    boolean executeImmediatelyAfterReset() default false;
    boolean executeImmediately() default false;
Yazawazi's avatar
Yazawazi committed
34
}