public interface EventListener
Subscribe annotation on methods they wish to receive events.
This interface therefore mainly represents a 'middle man' between the event bus and the actual subscribing
component. As such, event bus implementors (or framework/infrastructural implementors) or those that wish to
customize listener/dispatch functionality might find this concept useful.
It is a concept almost always used in conjunction with a EventListenerResolver implementation.SingleArgumentMethodEventListener,
AnnotationEventListenerResolver| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(Object event)
Returns
true if the listener instance can process the specified event object, false otherwise. |
void |
onEvent(Object event)
Handles the specified event.
|
boolean accepts(Object event)
true if the listener instance can process the specified event object, false otherwise.event - the event object to testtrue if the listener instance can process the specified event object, false otherwise.void onEvent(Object event)
event - the event to handle.Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.