类 XxlJobHelper
java.lang.Object
com.xxl.job.core.context.XxlJobHelper
helper for xxl-job
- 作者:
- xuxueli 2020-11-05
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static longgetJobId()current JobIdstatic Stringcurrent JobLogFileNamestatic Stringcurrent JobParamstatic intcurrent ShardIndexstatic intcurrent ShardTotalstatic booleanhandle failstatic booleanhandleFail(String handleMsg) handle fail with log msgstatic booleanhandleResult(int handleCode, String handleMsg) static booleanhandle successstatic booleanhandleSuccess(String handleMsg) handle success with log msgstatic booleanhandle timeoutstatic booleanhandleTimeout(String handleMsg) handle timeout with log msgstatic booleanappend log with patternstatic booleanappend exception stack
-
构造器详细资料
-
XxlJobHelper
public XxlJobHelper()
-
-
方法详细资料
-
getJobId
public static long getJobId()current JobId- 返回:
-
getJobParam
current JobParam- 返回:
-
getJobLogFileName
current JobLogFileName- 返回:
-
getShardIndex
public static int getShardIndex()current ShardIndex- 返回:
-
getShardTotal
public static int getShardTotal()current ShardTotal- 返回:
-
log
append log with pattern- 参数:
appendLogPattern- like "aaa {} bbb {} ccc"appendLogArguments- like "111, true"
-
log
append exception stack- 参数:
e-
-
handleSuccess
public static boolean handleSuccess()handle success- 返回:
-
handleSuccess
handle success with log msg- 参数:
handleMsg-- 返回:
-
handleFail
public static boolean handleFail()handle fail- 返回:
-
handleFail
handle fail with log msg- 参数:
handleMsg-- 返回:
-
handleTimeout
public static boolean handleTimeout()handle timeout- 返回:
-
handleTimeout
handle timeout with log msg- 参数:
handleMsg-- 返回:
-
handleResult
- 参数:
handleCode- 200 : success 500 : fail 502 : timeouthandleMsg-- 返回:
-