类 NotifyCenter
java.lang.Object
com.alibaba.nacos.common.notify.NotifyCenter
Unified Event Notify Center.
- 作者:
- liaochuntao, zongtanghu
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidderegisterPublisher(Class<? extends Event> eventType)Deregister publisher.static <T> voidderegisterSubscriber(Subscriber consumer)Deregister subscriber.static EventPublishergetPublisher(Class<? extends Event> topic)static Map<String,EventPublisher>static EventPublisherstatic booleanpublishEvent(Event event)Request publisher publish event Publishers load lazily, calling publisher.static <T> voidregisterSubscriber(Subscriber consumer)Register a Subscriber.static EventPublisherregisterToPublisher(Class<? extends Event> eventType, int queueMaxSize)Register publisher.static EventPublisherregisterToSharePublisher(Class<? extends SlowEvent> eventType)Register to share-publisher.static voidshutdown()Shutdown the several publisher instance which notify center has.
-
字段详细资料
-
ringBufferSize
public static int ringBufferSize
-
-
构造器详细资料
-
NotifyCenter
public NotifyCenter()
-
-
方法详细资料
-
getPublisherMap
-
getPublisher
-
shutdown
public static void shutdown()Shutdown the several publisher instance which notify center has. -
registerSubscriber
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
Deregister subscriber.- 参数:
consumer- subscriber instance.
-
publishEvent
Request publisher publish event Publishers load lazily, calling publisher. Start () only when the event is actually published.- 参数:
event- class Instances of the event.
-
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
Deregister publisher.- 参数:
eventType- class Instances type of the event type.
-