类 Subscriber<T extends Event>
- java.lang.Object
-
- com.alibaba.nacos.common.notify.listener.Subscriber<T>
-
- 直接已知子类:
SmartSubscriber
public abstract class Subscriber<T extends Event> extends java.lang.ObjectAn abstract subscriber class for subscriber interface.- 作者:
- liaochuntao, zongtanghu
-
-
构造器概要
构造器 构造器 说明 Subscriber()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 java.util.concurrent.Executorexecutor()It is up to the listener to determine whether the callback is asynchronous or synchronous.booleanignoreExpireEvent()Whether to ignore expired events.abstract voidonEvent(T event)Event callback.booleanscopeMatches(T event)Whether the event's scope matches current subscriber.abstract java.lang.Class<? extends Event>subscribeType()Type of this subscriber's subscription.
-
-
-
方法详细资料
-
subscribeType
public abstract java.lang.Class<? extends Event> subscribeType()
Type of this subscriber's subscription.- 返回:
- Class which extends
Event
-
executor
public java.util.concurrent.Executor executor()
It is up to the listener to determine whether the callback is asynchronous or synchronous.- 返回:
Executor
-
ignoreExpireEvent
public boolean ignoreExpireEvent()
Whether to ignore expired events.- 返回:
- default value is
Boolean.FALSE
-
scopeMatches
public boolean scopeMatches(T event)
Whether the event's scope matches current subscriber. Default implementation is all scopes matched. If you override this method, it better to override relatedEvent.scope().- 参数:
event-Event- 返回:
- Whether the event's scope matches current subscriber
-
-