类 GenericApplicationListenerAdapter
- java.lang.Object
- org.springframework.context.event.GenericApplicationListenerAdapter
- 所有已实现的接口:
EventListener
,ApplicationListener<ApplicationEvent>
,GenericApplicationListener
,SmartApplicationListener
,Ordered
public class GenericApplicationListenerAdapter extends Object implements GenericApplicationListener, SmartApplicationListener
GenericApplicationListener
adapter that determines supported event types through introspecting the generically declared type of the target listener.- 从以下版本开始:
- 3.0
- 作者:
- Juergen Hoeller, Stephane Nicoll
- 另请参阅:
ApplicationListener.onApplicationEvent(E)
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 GenericApplicationListenerAdapter(ApplicationListener<?> delegate)
Create a new GenericApplicationListener for the given delegate.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getOrder()
Get the order value of this object.void
onApplicationEvent(ApplicationEvent event)
Handle an application event.boolean
supportsEventType(Class<? extends ApplicationEvent> eventType)
Determine whether this listener actually supports the given event type.boolean
supportsEventType(ResolvableType eventType)
Determine whether this listener actually supports the given event type.boolean
supportsSourceType(Class<?> sourceType)
Determine whether this listener actually supports the given source type.
构造器详细资料
GenericApplicationListenerAdapter
public GenericApplicationListenerAdapter(ApplicationListener<?> delegate)
Create a new GenericApplicationListener for the given delegate.- 参数:
delegate
- the delegate listener to be invoked
方法详细资料
onApplicationEvent
public void onApplicationEvent(ApplicationEvent event)
从接口复制的说明:ApplicationListener
Handle an application event.- 指定者:
onApplicationEvent
在接口中ApplicationListener<ApplicationEvent>
- 参数:
event
- the event to respond to
supportsEventType
public boolean supportsEventType(ResolvableType eventType)
从接口复制的说明:GenericApplicationListener
Determine whether this listener actually supports the given event type.- 指定者:
supportsEventType
在接口中GenericApplicationListener
- 参数:
eventType
- the event type (nevernull
)
supportsEventType
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
从接口复制的说明:SmartApplicationListener
Determine whether this listener actually supports the given event type.- 指定者:
supportsEventType
在接口中SmartApplicationListener
- 参数:
eventType
- the event type (nevernull
)
supportsSourceType
public boolean supportsSourceType(Class<?> sourceType)
从接口复制的说明:GenericApplicationListener
Determine whether this listener actually supports the given source type.- 指定者:
supportsSourceType
在接口中GenericApplicationListener
- 指定者:
supportsSourceType
在接口中SmartApplicationListener
- 参数:
sourceType
- the source type, ornull
if no source
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE