类 AbstractEventPublisher

java.lang.Object
top.jiaojinxin.jln.event.AbstractEventPublisher
所有已实现的接口:
com.lmax.disruptor.EventHandler<AbstractEventPublisher.DisruptorEvent>, EventListener, org.springframework.boot.ApplicationRunner, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>, EventPublisher
直接已知子类:
DefaultEventPublisher

public abstract class AbstractEventPublisher extends Object implements EventPublisher, org.springframework.boot.ApplicationRunner, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>, com.lmax.disruptor.EventHandler<AbstractEventPublisher.DisruptorEvent>
事件发布者抽象实现
作者:
JiaoJinxin
  • 构造器详细资料

    • AbstractEventPublisher

      protected AbstractEventPublisher(int ringBufferSize, String threadNamePrefix, com.lmax.disruptor.dsl.ProducerType producerType, com.lmax.disruptor.WaitStrategy waitStrategy)
      构造方法
      参数:
      ringBufferSize - 循环队列长度
      threadNamePrefix - 线程名称前缀
      producerType - 生产者类型
      waitStrategy - 等待策略
  • 方法详细资料

    • publish

      public void publish(Event event)
      从接口复制的说明: EventPublisher
      发布事件
      指定者:
      publish 在接口中 EventPublisher
      参数:
      event - 事件
    • onEvent

      public void onEvent(AbstractEventPublisher.DisruptorEvent event, long sequence, boolean endOfBatch)
      指定者:
      onEvent 在接口中 com.lmax.disruptor.EventHandler<AbstractEventPublisher.DisruptorEvent>
    • run

      public void run(org.springframework.boot.ApplicationArguments args)
      指定者:
      run 在接口中 org.springframework.boot.ApplicationRunner
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.event.ContextClosedEvent event)
      指定者:
      onApplicationEvent 在接口中 org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
    • doPublish

      protected abstract void doPublish(Event event)
      执行事件发布
      参数:
      event - 事件