public abstract class AbstractLogicHandler<T> extends Object
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractLogicHandler() |
protected |
AbstractLogicHandler(LogicHandlerBaseInfo logicHandlerBaseInfo) |
protected |
AbstractLogicHandler(LogicHandlerBaseInfo logicHandlerBaseInfo,
String logStr) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
afterProcess()
无论成功失败,最后都会执行
|
protected ProcessResult<T> |
buildBusinessFailResult(Integer code,
String msg)
构建业务失败结果
|
protected ProcessResult<T> |
buildBusinessFailResult(String msg)
构建业务失败结果
|
protected ProcessResult<T> |
buildFailResult(Integer code,
String msg)
构建失败结果
|
protected <T> NodeChainContext<T> |
buildNodeChainContext(Class<T> clazz)
构建上下文
|
protected ProcessResult<T> |
buildSuccessResult(T data)
构建成功结果
|
protected ProcessResult<T> |
buildUnknownFailResult(String msg)
构建未知失败结果
|
protected void |
businessFail(Integer code,
String msg)
业务失败
|
protected void |
businessFail(String msg)
业务失败
|
protected abstract void |
checkParams()
参数校验
|
ProcessResult<T> |
execute() |
protected void |
executeNodeChain(Class<? extends AbstractNodeChain> clazz,
AbstractNodeChain.LogLevelEnum logLevel,
NodeChainContext<?> nodeChainContext)
执行指定节点链
|
protected void |
executeNodeChain(Class<? extends AbstractNodeChain> clazz,
AbstractNodeChain.LogLevelEnum logLevel,
NodeChainContext<?> nodeChainContext,
ThreadPoolExecutor threadPoolExecutor)
执行指定节点链
|
protected void |
executeNodeChain(Class<? extends AbstractNodeChain> clazz,
NodeChainContext<?> nodeChainContext) |
protected void |
executeNodeChain(Class<? extends AbstractNodeChain> clazz,
NodeChainContext<?> nodeChainContext,
ThreadPoolExecutor threadPoolExecutor) |
protected void |
onBusinessFail()
业务失败时执行
|
protected void |
onSuccess()
成功时执行
|
protected void |
onUnknowFail()
未知失败时执行
|
protected abstract ProcessResult<T> |
process()
执行方法
|
protected AbstractLogicHandler()
protected AbstractLogicHandler(LogicHandlerBaseInfo logicHandlerBaseInfo)
protected AbstractLogicHandler(LogicHandlerBaseInfo logicHandlerBaseInfo, String logStr)
protected abstract void checkParams()
protected abstract ProcessResult<T> process()
public ProcessResult<T> execute()
protected void executeNodeChain(Class<? extends AbstractNodeChain> clazz, NodeChainContext<?> nodeChainContext, ThreadPoolExecutor threadPoolExecutor)
protected void executeNodeChain(Class<? extends AbstractNodeChain> clazz, NodeChainContext<?> nodeChainContext)
protected void executeNodeChain(Class<? extends AbstractNodeChain> clazz, AbstractNodeChain.LogLevelEnum logLevel, NodeChainContext<?> nodeChainContext, ThreadPoolExecutor threadPoolExecutor)
clazz - clazzlogLevel - logLevelnodeChainContext - nodeChainContextthreadPoolExecutor - threadPoolExecutorprotected void executeNodeChain(Class<? extends AbstractNodeChain> clazz, AbstractNodeChain.LogLevelEnum logLevel, NodeChainContext<?> nodeChainContext)
clazz - clazzlogLevel - logLevelnodeChainContext - nodeChainContextprotected void businessFail(String msg)
msg - msgprotected void afterProcess()
protected <T> NodeChainContext<T> buildNodeChainContext(Class<T> clazz)
protected ProcessResult<T> buildSuccessResult(T data)
protected ProcessResult<T> buildFailResult(Integer code, String msg)
protected ProcessResult<T> buildUnknownFailResult(String msg)
protected ProcessResult<T> buildBusinessFailResult(String msg)
protected ProcessResult<T> buildBusinessFailResult(Integer code, String msg)
protected void onSuccess()
protected void onUnknowFail()
protected void onBusinessFail()
Copyright © 2022. All rights reserved.