Skip to content

Commit

Permalink
Polish apache#4268 : Update JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Jun 8, 2019
1 parent de63bdb commit 4673c3b
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <code>final</code> the implementation can't override. It's notable that all {@link Event event} handle methods must
* meet following conditions:
* <ul>
* <li>not {@link #onEvent(Event)} method</li>
* <li><code>public</code> accessibility</li>
* <li><code>void</code> return type</li>
* <li>no {@link Exception exception} declaration</li>
* <li>only one {@link Event} type argument</li>
* </ul>
*
* @see Event
* @see EventListener
Expand All @@ -54,7 +64,6 @@ private Method findOnEventMethod() {
private Map<Class<?>, Set<Method>> findHandleEventMethods() {
// Event class for key, the eventMethods' Set as value
Map<Class<?>, Set<Method>> eventMethods = new HashMap<>();

of(getClass().getMethods())
.filter(this::isHandleEventMethod)
.forEach(method -> {
Expand All @@ -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:
* <ul>
* <li>not {@link #onEvent(Event)} method</li>
* <li><code>public</code> accessibility</li>
Expand Down

0 comments on commit 4673c3b

Please sign in to comment.