Interface EventDispatcher
- All Known Implementing Classes:
AsyncDispatcher, SyncDispatcher
public interface EventDispatcher
Event Dispatcher Interface
事件分发器接口
Interface for dispatching events to registered listeners.
将事件分发到注册的监听器的接口。
Features | 主要功能:
- Event dispatching - 事件分发
- Priority ordering - 优先级排序
- Sync/Async support - 同步/异步支持
Usage Examples | 使用示例:
EventDispatcher dispatcher = new SyncDispatcher();
dispatcher.dispatch(event, listeners);
Security | 安全性:
- Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
- Since:
- JDK 25, opencode-base-event V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Details
-
dispatch
-
isAsync
default boolean isAsync()Check if this dispatcher supports async dispatching 检查此分发器是否支持异步分发- Returns:
- true if supports async | 如果支持异步返回true
-
shutdown
default void shutdown()Shutdown the dispatcher and release resources 关闭分发器并释放资源
-