类 NotifyCenter

java.lang.Object
com.alibaba.nacos.common.notify.NotifyCenter

public class NotifyCenter extends Object
Unified Event Notify Center.
作者:
liaochuntao, zongtanghu
  • 字段详细资料

    • ringBufferSize

      public static int ringBufferSize
    • shareBufferSize

      public static int shareBufferSize
  • 构造器详细资料

    • NotifyCenter

      public NotifyCenter()
  • 方法详细资料

    • getPublisherMap

      public static Map<String,​EventPublisher> getPublisherMap()
    • getPublisher

      public static EventPublisher getPublisher(Class<? extends Event> topic)
    • getSharePublisher

      public static EventPublisher getSharePublisher()
    • shutdown

      public static void shutdown()
      Shutdown the several publisher instance which notify center has.
    • registerSubscriber

      public static <T> void registerSubscriber(Subscriber consumer)
      Register a Subscriber. If the Publisher concerned by the Subscriber does not exist, then PublihserMap will preempt a placeholder Publisher first.
      类型参数:
      T - event type
      参数:
      consumer - subscriber
    • deregisterSubscriber

      public static <T> void deregisterSubscriber(Subscriber consumer)
      Deregister subscriber.
      参数:
      consumer - subscriber instance.
    • publishEvent

      public static boolean publishEvent(Event event)
      Request publisher publish event Publishers load lazily, calling publisher. Start () only when the event is actually published.
      参数:
      event - class Instances of the event.
    • registerToSharePublisher

      public static EventPublisher registerToSharePublisher(Class<? extends SlowEvent> eventType)
      Register to share-publisher.
      参数:
      eventType - class Instances type of the event type.
      返回:
      share publisher instance.
    • registerToPublisher

      public static EventPublisher registerToPublisher(Class<? extends Event> eventType, int queueMaxSize)
      Register publisher.
      参数:
      eventType - class Instances type of the event type.
      queueMaxSize - the publisher's queue max size.
    • deregisterPublisher

      public static void deregisterPublisher(Class<? extends Event> eventType)
      Deregister publisher.
      参数:
      eventType - class Instances type of the event type.