E - the concrete class of Dubbo Event@SPI @FunctionalInterface public interface EventListener<E extends Event> extends EventListener, Prioritized
Dubbo Event Listener that is based on Java standard EventListener interface supports
the generic Event.
The handle method will be notified when the matched-type Dubbo Event is
published, whose priority could be changed by getPriority() method.
Event,
EventListenerCOMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY| 限定符和类型 | 方法和说明 |
|---|---|
static Class<? extends Event> |
findEventType(Class<?> listenerClass)
|
static Class<? extends Event> |
findEventType(EventListener<?> listener)
|
static Class<? extends Event> |
findEventType(ParameterizedType parameterizedType)
Find the type
Dubbo event from the specified ParameterizedType presents
a class of Dubbo event listener |
default int |
getPriority()
The priority of
current listener. |
void |
onEvent(E event)
Handle a
Dubbo Event when it's be published |
compareTovoid onEvent(E event)
Dubbo Event when it's be publishedevent - a Dubbo Eventdefault int getPriority()
current listener.getPriority 在接口中 PrioritizedInteger.MIN_VALUE indicates the highest priority. The default value is Integer.MAX_VALUE.
The comparison rule , refer to Prioritized.compareTo(org.apache.dubbo.common.lang.Prioritized).static Class<? extends Event> findEventType(EventListener<?> listener)
listener - the class of Dubbo event listenernull if not foundstatic Class<? extends Event> findEventType(Class<?> listenerClass)
listenerClass - the class of Dubbo event listenernull if not foundstatic Class<? extends Event> findEventType(ParameterizedType parameterizedType)
Dubbo event from the specified ParameterizedType presents
a class of Dubbo event listenerparameterizedType - the ParameterizedType presents a class of Dubbo event listenernull if not foundCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.