public interface ExecutionContext
| 限定符和类型 | 方法和说明 |
|---|---|
<T> reactor.core.publisher.Mono<T> |
fireEvent(String event,
RuleData data)
触发事件,此方法永远返回
Mono.empty() |
default FlowScope |
flow()
获取当前规则流作用域
|
default FlowScope |
flow(String id)
获取指定的规则流作用域
|
Input |
getInput()
获取输入接口,用于从上游接收数据
|
String |
getInstanceId() |
ScheduleJob |
getJob()
获取任务信息
|
Logger |
getLogger()
获取日志接口,通过此日志接口打印的日志可进行试试日志展示和记录
|
Output |
getOutput()
获取输出接口,用于向下游节点输出数据
|
GlobalScope |
global() |
boolean |
isDebug() |
default Logger |
logger()
|
RuleData |
newRuleData(Object data)
创建规则数据
|
default NodeScope |
node()
获取当前规则节点作用域
|
default NodeScope |
node(String id)
获取指定节点的作用域
|
default <T> reactor.core.publisher.Mono<T> |
onError(@NotNull java.util.function.Supplier<Throwable> e,
RuleData sourceData)
异步触发错误消息,在某些条件需要手动触发错误时,可以使用此方法。
|
<T> reactor.core.publisher.Mono<T> |
onError(Throwable e,
RuleData sourceData)
触发error,此方法永远返回
Mono.empty(),此操作也会触发RuleConstants.Event.error事件 |
void |
onShutdown(Runnable runnable)
监听停止事件
|
default ContextScope |
scope(RuleData ruleData)
根据规则数据来获取上下文作用域,默认使用
RuleData#getContextId()作为上下文ID |
default ContextScope |
scope(String id)
获取上下文作用域
|
reactor.core.publisher.Mono<Void> |
shutdown(String code,
String message)
停止规则
|
String getInstanceId()
Logger getLogger()
default Logger logger()
ScheduleJob getJob()
<T> reactor.core.publisher.Mono<T> fireEvent(@Nonnull String event, @Nonnull RuleData data)
Mono.empty()T - 适配empty 泛型event - 事件标识data - 规则数据<T> reactor.core.publisher.Mono<T> onError(@Nullable Throwable e, @Nullable RuleData sourceData)
Mono.empty(),此操作也会触发RuleConstants.Event.error事件T - 适配empty 泛型e - 异常信息sourceData - 规则数据default <T> reactor.core.publisher.Mono<T> onError(@NotNull
@NotNull java.util.function.Supplier<Throwable> e,
@Nullable
RuleData sourceData)
mono
.switchIfEmpty(context.onError(RuntimeException::new,data))
T - 适配empty 泛型e - 异常提供信息sourceData - 规则数据Input getInput()
Output getOutput()
reactor.core.publisher.Mono<Void> shutdown(String code, String message)
code - 停止原因码message - 消息void onShutdown(Runnable runnable)
runnable - 事件监听器boolean isDebug()
GlobalScope global()
default ContextScope scope(String id)
id - 上下文IDdefault ContextScope scope(RuleData ruleData)
RuleData#getContextId()作为上下文IDruleData - 规则数据default NodeScope node()
default FlowScope flow()
Copyright © 2019–2021. All rights reserved.