接口 StrategyEventManager<T>
- 所有已知子接口:
AccountStatusEventManager,ApplicationStrategyEventManager<T>,RequestMappingScanEventManager
public interface StrategyEventManager<T>
Description: 策略 Event 定义
为了同时支持 分布式模式 和 单体式模式。所以很多事件均需要同时支持本地发送和远程发送两种模式。 抽象本定义用于统一处理两种模式的事件支持。
- 作者:
- : gengwei.zheng
- Date:
- : 2022/2/5 15:32
-
方法概要
修饰符和类型方法说明default boolean是否是本地处理事件。voidpostLocalProcess(T data) 创建本地事件default voidpostProcess(String originService, String destinationService, T data) 发送事件default voidpostProcess(String destinationService, T data) 发送事件voidpostRemoteProcess(String data, String originService, String destinationService) 创建远程事件default voidpublishEvent(org.springframework.context.ApplicationEvent event) 发送 Spring Event
-
方法详细资料
-
postLocalProcess
创建本地事件- 参数:
data- 事件携带数据
-
postRemoteProcess
创建远程事件- 参数:
data- 事件携带数据。JSON 格式的数据。originService- 发送远程事件原始服务destinationService- 接收远程事件目的地
-
isLocal
是否是本地处理事件。- 参数:
destinationService- 接收远程事件目的地- 返回:
- false 远程事件,local 本地事件
-
postProcess
发送事件- 参数:
data- 事件携带数据destinationService- 接收远程事件目的地
-
postProcess
发送事件- 参数:
data- 事件携带数据originService- 发送远程事件原始服务destinationService- 接收远程事件目的地
-
publishEvent
default void publishEvent(org.springframework.context.ApplicationEvent event) 发送 Spring Event- 参数:
event- 自定义 Spring Event
-