forked from kidgrow-microservices-platform

zhaoxiaohao
2020-10-30 2e109492d152e08bfca445b54f15c91a2334f21c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.xxl.job.core.handler;
 
import com.xxl.job.core.biz.model.ReturnT;
 
/**
 * job handler
 *
 * @author xuxueli 2015-12-19 19:06:38
 */
public abstract class IJobHandler {
 
 
    /** success */
    public static final ReturnT<String> SUCCESS = new ReturnT<String>(200, null);
    /** fail */
    public static final ReturnT<String> FAIL = new ReturnT<String>(500, null);
    /** fail timeout */
    public static final ReturnT<String> FAIL_TIMEOUT = new ReturnT<String>(502, null);
 
 
    /**
     * execute handler, invoked when executor receives a scheduling request
     *
     * @param param
     * @return
     * @throws Exception
     */
    public abstract ReturnT<String> execute(String param) throws Exception;
 
 
    /**
     * init handler, invoked when JobThread init
     */
    public void init() {
        // TODO
    }
 
 
    /**
     * destroy handler, invoked when JobThread destroy
     */
    public void destroy() {
        // TODO
    }
 
 
}