接口 GenericApplicationListener
- 所有已知实现类:
ApplicationListenerMethodAdapter
,GenericApplicationListenerAdapter
,SourceFilteringListener
public interface GenericApplicationListener extends ApplicationListener<ApplicationEvent>, Ordered
Extended variant of the standardApplicationListener
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.- 从以下版本开始:
- 4.2
- 作者:
- Stephane Nicoll
- 另请参阅:
SmartApplicationListener
,GenericApplicationListenerAdapter
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default int
getOrder()
Determine this listener's order in a set of listeners for the same event.boolean
supportsEventType(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.从接口继承的方法 org.springframework.context.ApplicationListener
onApplicationEvent
方法详细资料
supportsEventType
boolean supportsEventType(ResolvableType eventType)
Determine whether this listener actually supports the given event type.- 参数:
eventType
- the event type (nevernull
)
supportsSourceType
default boolean supportsSourceType(@Nullable Class<?> sourceType)
Determine whether this listener actually supports the given source type.The default implementation always returns
true
.- 参数:
sourceType
- the source type, ornull
if no source
getOrder
default int getOrder()
Determine this listener's order in a set of listeners for the same event.The default implementation returns
Ordered.LOWEST_PRECEDENCE
.- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE