接口 EventListener<E extends Event>
-
- 类型参数:
E- the concrete class ofDubbo Event
- 所有超级接口:
Comparable<Prioritized>,EventListener,Prioritized
- 所有已知子接口:
ConditionalEventListener<E>
- 所有已知实现类:
GenericEventListener
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@SPI @FunctionalInterface public interface EventListener<E extends Event> extends EventListener, Prioritized
TheDubbo EventListener that is based on Java standardEventListenerinterface supports the genericEvent.The
handle methodwill be notified when the matched-typeDubbo Eventis published, whose priority could be changed bygetPriority()method.- 从以下版本开始:
- 2.7.5
- 另请参阅:
Event,EventListener
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 static Class<? extends Event>findEventType(Class<?> listenerClass)static Class<? extends Event>findEventType(ParameterizedType parameterizedType)Find the typeDubbo eventfrom the specifiedParameterizedTypepresents a class ofDubbo event listenerstatic Class<? extends Event>findEventType(EventListener<?> listener)default intgetPriority()The priority ofcurrent listener.voidonEvent(E event)Handle aDubbo Eventwhen it's be published-
从接口继承的方法 org.apache.dubbo.common.lang.Prioritized
compareTo
-
-
-
-
方法详细资料
-
onEvent
void onEvent(E event)
Handle aDubbo Eventwhen it's be published- 参数:
event- aDubbo Event
-
getPriority
default int getPriority()
The priority ofcurrent listener.- 指定者:
getPriority在接口中Prioritized- 返回:
- the value is more greater, the priority is more lower.
Integer.MIN_VALUEindicates the highest priority. The default value isInteger.MAX_VALUE. The comparison rule , refer toPrioritized.compareTo(org.apache.dubbo.common.lang.Prioritized).
-
findEventType
static Class<? extends Event> findEventType(EventListener<?> listener)
- 参数:
listener- theclassofDubbo event listener- 返回:
nullif not found
-
findEventType
static Class<? extends Event> findEventType(Class<?> listenerClass)
- 参数:
listenerClass- theclassofDubbo event listener- 返回:
nullif not found
-
findEventType
static Class<? extends Event> findEventType(ParameterizedType parameterizedType)
Find the typeDubbo eventfrom the specifiedParameterizedTypepresents a class ofDubbo event listener- 参数:
parameterizedType- theParameterizedTypepresents a class ofDubbo event listener- 返回:
nullif not found
-
-