public class EC extends Object
| 限定符和类型 | 类和说明 |
|---|---|
class |
EC.ResultRecord
每个监听器对应的执行结果
|
| 限定符和类型 | 字段和说明 |
|---|---|
Object[] |
args
目标方法的参数
|
protected Boolean |
async
强制异步.
|
protected Map<Object,Object> |
attrs
属性集
|
protected Consumer<EC> |
completeFn
事件执行完成的回调函数
|
String |
eName
此次执行的事件名
|
protected EP |
ep
是由哪个事件发布器发布的
|
protected Queue<Listener> |
failPassed
执行失败的事件监听
|
protected String |
id
一次事件执行的id.
|
protected List<EC.ResultRecord> |
results
结果集
|
protected Object |
source
事件源
|
protected long |
start
开始时间
|
protected AtomicBoolean |
stopped
是否结束
|
protected Queue<Listener> |
successPassed
成功执行过的事件监听
|
protected boolean |
track
是否追踪执行.用于调试
|
protected List<Listener> |
willPass
要执行的事件链
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected EC |
addResult(Listener listener,
Throwable ex,
Object r) |
EC |
args(Object... args) |
EC |
async(Boolean async) |
EC |
attr(Object key,
Object value) |
Consumer<EC> |
completeFn()
获取事件结束函数
|
EC |
completeFn(Consumer<EC> completeFn)
设置完成时回调函数
|
EC |
debug()
设置debug模式, 日志打印 事件执行前后详情
|
EP |
ep() |
Throwable |
ex()
返回第一个异常
|
List<Throwable> |
exs()
所有监听器执行的异常
|
Object |
getAttr(Object key) |
<T> T |
getAttr(Object key,
Class<T> type) |
<T> T |
getAttr(Object key,
Class<T> type,
T defaultValue) |
String |
id()
当前事件id
|
EC |
id(String id)
设置id
|
Boolean |
isForceAsync()
是否为强制异步执行
|
boolean |
isNoListener()
是否没有监听器
|
boolean |
isStopped() |
boolean |
isSuccess()
事件是否执行成功
|
boolean |
isTrack()
是否是debug模式
|
List<EC.ResultRecord> |
originResults() |
protected EC |
passed(Listener l,
boolean success)
passed一个Listener 代表执行完成一个Listener.
|
Object |
result()
取第一个结果
|
List<Object> |
results()
所有结果
|
Object |
source() |
EC |
source(Object s) |
protected EC |
start(List<Listener> ls,
EP ep)
开始执行,初始化
|
EC |
sync()
强制同步执行
|
protected void |
tryFinish()
此次事件执行完成
|
protected String id
protected boolean track
public Object[] args
protected EP ep
public final String eName
protected Object source
protected long start
protected final List<EC.ResultRecord> results
protected final AtomicBoolean stopped
public EC(String eName)
protected void tryFinish()
protected EC passed(Listener l, boolean success)
l - Listenersuccess - 成功执行public boolean isSuccess()
public boolean isNoListener()
public EC sync()
public Boolean isForceAsync()
public EC debug()
public boolean isTrack()
public String id()
public Object source()
public Throwable ex()
public Object result()
public List<EC.ResultRecord> originResults()
public EP ep()
public boolean isStopped()
Copyright © 2024. All rights reserved.