接口 StrategyEventManager<T>

所有已知子接口:
AccountStatusEventManager, ApplicationStrategyEventManager<T>, RequestMappingScanEventManager

public interface StrategyEventManager<T>

Description: 策略 Event 定义

为了同时支持 分布式模式 和 单体式模式。所以很多事件均需要同时支持本地发送和远程发送两种模式。 抽象本定义用于统一处理两种模式的事件支持。

作者:
: gengwei.zheng
Date:
: 2022/2/5 15:32
  • 方法详细资料

    • postLocalProcess

      void postLocalProcess(T data)
      创建本地事件
      参数:
      data - 事件携带数据
    • postRemoteProcess

      void postRemoteProcess(String data, String originService, String destinationService)
      创建远程事件
      参数:
      data - 事件携带数据。JSON 格式的数据。
      originService - 发送远程事件原始服务
      destinationService - 接收远程事件目的地
    • isLocal

      default boolean isLocal(String destinationService)
      是否是本地处理事件。
      参数:
      destinationService - 接收远程事件目的地
      返回:
      false 远程事件,local 本地事件
    • postProcess

      default void postProcess(String destinationService, T data)
      发送事件
      参数:
      data - 事件携带数据
      destinationService - 接收远程事件目的地
    • postProcess

      default void postProcess(String originService, String destinationService, T data)
      发送事件
      参数:
      data - 事件携带数据
      originService - 发送远程事件原始服务
      destinationService - 接收远程事件目的地