public interface GenericApplicationListener extends ApplicationListener<ApplicationEvent>, org.springframework.core.Ordered
ApplicationListener interface,
exposing further metadata such as the supported event and source type.
As of Spring Framework 4.2, this interface supersedes the Class-based
SmartApplicationListener with full handling of generic event types.
SmartApplicationListener,
GenericApplicationListenerAdapter| Modifier and Type | Method and Description |
|---|---|
default int |
getOrder()
Determine this listener's order in a set of listeners for the same event.
|
boolean |
supportsEventType(org.springframework.core.ResolvableType eventType)
Determine whether this listener actually supports the given event type.
|
default boolean |
supportsSourceType(Class<?> sourceType)
Determine whether this listener actually supports the given source type.
|
onApplicationEventboolean supportsEventType(org.springframework.core.ResolvableType eventType)
eventType - the event type (never null)default boolean supportsSourceType(@Nullable
Class<?> sourceType)
The default implementation always returns true.
sourceType - the source type, or null if no sourcedefault int getOrder()
The default implementation returns Ordered.LOWEST_PRECEDENCE.
getOrder in interface org.springframework.core.Ordered