类 DefaultPublisher
java.lang.Object
java.lang.Thread
com.alibaba.nacos.common.notify.DefaultPublisher
- 所有已实现的接口:
Closeable,EventPublisher,Runnable
- 直接已知子类:
DefaultSharePublisher
- 作者:
- liaochuntao, zongtanghu
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
字段概要
字段修饰符和类型字段说明protected Longprotected static org.slf4j.Loggerprotected ConcurrentHashSet<Subscriber>从类继承的字段 java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddSubscriber(Subscriber subscriber)Add listener.longThe number of currently staged events.voidInitializes the event publisher.booleanvoidnotifySubscriber(Subscriber subscriber, Event event)Notify listener.booleanpublish event.voidremoveSubscriber(Subscriber subscriber)Remove listener.voidrun()voidshutdown()Shutdown the Resources, such as Thread Pool.voidstart()从类继承的方法 java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
字段详细资料
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
subscribers
-
lastEventSequence
-
-
构造器详细资料
-
DefaultPublisher
public DefaultPublisher()
-
-
方法详细资料
-
init
从接口复制的说明:EventPublisherInitializes the event publisher.- 指定者:
init在接口中EventPublisher- 参数:
type->bufferSize- Message staging queue size
-
getSubscribers
-
start
public void start() -
currentEventSize
public long currentEventSize()从接口复制的说明:EventPublisherThe number of currently staged events.- 指定者:
currentEventSize在接口中EventPublisher- 返回:
- event size
-
run
public void run() -
addSubscriber
从接口复制的说明:EventPublisherAdd listener.- 指定者:
addSubscriber在接口中EventPublisher- 参数:
subscriber-Subscriber
-
removeSubscriber
从接口复制的说明:EventPublisherRemove listener.- 指定者:
removeSubscriber在接口中EventPublisher- 参数:
subscriber-Subscriber
-
publish
从接口复制的说明:EventPublisherpublish event.- 指定者:
publish在接口中EventPublisher- 参数:
event-Event- 返回:
- publish event is success
-
shutdown
public void shutdown()从接口复制的说明:CloseableShutdown the Resources, such as Thread Pool. -
isInitialized
public boolean isInitialized() -
notifySubscriber
从接口复制的说明:EventPublisherNotify listener.- 指定者:
notifySubscriber在接口中EventPublisher- 参数:
subscriber-Subscriberevent-Event
-