类 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 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 voidregisterSubscriber(Subscriber consumer) Register a Subscriber.static voidregisterSubscriber(Subscriber consumer, EventPublisherFactory factory) Register a Subscriber.static EventPublisherregisterToPublisher(Class<? extends Event> eventType, int queueMaxSize) Register publisher with default factory.static voidregisterToPublisher(Class<? extends Event> eventType, EventPublisher publisher) Register publisher.static EventPublisherregisterToPublisher(Class<? extends Event> eventType, EventPublisherFactory factory, int queueMaxSize) Register publisher with specified factory.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 with default EventPublisherFactory first.- 参数:
consumer- subscriber
-
registerSubscriber
Register a Subscriber. If the Publisher concerned by the Subscriber does not exist, then PublihserMap will preempt a placeholder Publisher with specified EventPublisherFactory first.- 参数:
consumer- subscriberfactory- publisher factory.
-
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 with default factory.- 参数:
eventType- class Instances type of the event type.queueMaxSize- the publisher's queue max size.
-
registerToPublisher
public static EventPublisher registerToPublisher(Class<? extends Event> eventType, EventPublisherFactory factory, int queueMaxSize) Register publisher with specified factory.- 参数:
eventType- class Instances type of the event type.factory- publisher factory.queueMaxSize- the publisher's queue max size.
-
registerToPublisher
Register publisher.- 参数:
eventType- class Instances type of the event type.publisher- the specified event publisher
-
deregisterPublisher
Deregister publisher.- 参数:
eventType- class Instances type of the event type.
-