Interface StrategyEventManager<T>

All Known Subinterfaces:
AccountStatusEventManager, ApplicationStrategyEventManager<T>, RequestMappingScanEventManager

public interface StrategyEventManager<T>

Description: 策略 Event 定义

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

Author:
: gengwei.zheng
Date:
: 2022/2/5 15:32
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    isLocal(String destinationService)
    是否是本地处理事件。
    void
    创建本地事件
    default void
    postProcess(String originService, String destinationService, T data)
    发送事件
    default void
    postProcess(String destinationService, T data)
    发送事件
    void
    postRemoteProcess(String data, String originService, String destinationService)
    创建远程事件
    default void
    publishEvent(org.springframework.context.ApplicationEvent event)
    发送 Spring Event
  • Method Details

    • postLocalProcess

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

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

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

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

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

      default void publishEvent(org.springframework.context.ApplicationEvent event)
      发送 Spring Event
      Parameters:
      event - 自定义 Spring Event