From 4673c3b201b8050e615088dd271fdbd3d7d67598 Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Sun, 9 Jun 2019 00:28:12 +0800 Subject: [PATCH] Polish apache/incubator-dubbo#4268 : Update JavaDoc --- .../apache/dubbo/event/GenericEventListener.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dubbo-event/src/main/java/org/apache/dubbo/event/GenericEventListener.java b/dubbo-event/src/main/java/org/apache/dubbo/event/GenericEventListener.java index 3e37ddd5620..065be3c553e 100644 --- a/dubbo-event/src/main/java/org/apache/dubbo/event/GenericEventListener.java +++ b/dubbo-event/src/main/java/org/apache/dubbo/event/GenericEventListener.java @@ -30,7 +30,17 @@ import static org.apache.dubbo.common.function.ThrowableFunction.execute; /** - * An abstract class of {@link EventListener} for Generic events + * An abstract class of {@link EventListener} for Generic events, the sub class could add more {@link Event event} + * handle methods, rather than only binds the {@link EventListener#onEvent(Event)} method that is declared to be + * final the implementation can't override. It's notable that all {@link Event event} handle methods must + * meet following conditions: + * * * @see Event * @see EventListener @@ -54,7 +64,6 @@ private Method findOnEventMethod() { private Map, Set> findHandleEventMethods() { // Event class for key, the eventMethods' Set as value Map, Set> eventMethods = new HashMap<>(); - of(getClass().getMethods()) .filter(this::isHandleEventMethod) .forEach(method -> { @@ -75,7 +84,7 @@ public final void onEvent(Event event) { } /** - * Method must meet these conditions: + * The {@link Event event} handle methods must meet following conditions: *
    *
  • not {@link #onEvent(Event)} method
  • *
  • public accessibility