Class SpringEventHandler

java.lang.Object
com.codingapi.springboot.framework.handler.SpringEventHandler
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationListener<DomainEvent>

public class SpringEventHandler extends Object implements org.springframework.context.ApplicationListener<DomainEvent>
handler订阅的Spring触发器,在异步的情况下可配置多线程。
  • Field Details

    • THREAD_KEY

      public static final String THREAD_KEY
      异步多线程的KEY 可通过 System.setProperty(THREAD_KEY,"20") 调整线程数
      See Also:
  • Constructor Details

    • SpringEventHandler

      public SpringEventHandler(List<IHandler> handlers)
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(DomainEvent domainEvent)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<DomainEvent>