Java 类org.springframework.context.event.GenericApplicationListenerAdapter 实例源码

项目:enhanced-snapshots    文件:RefreshingDelegatingFilterProxy.java   
@Override
protected Filter initDelegate(WebApplicationContext wac) throws ServletException {
    Filter filter = super.initDelegate(wac);
    if(!listenerRegistered) {
        ((AbstractApplicationContext) wac).getApplicationListeners().add(new GenericApplicationListenerAdapter(this));
        listenerRegistered = true;
    }
    return filter;
}
项目:cuba    文件:UiEventsMulticasterImpl.java   
protected boolean supportsEvent(ApplicationListener<?> listener, ResolvableType eventType, Class<?> sourceType) {
    GenericApplicationListener smartListener = (listener instanceof GenericApplicationListener ?
            (GenericApplicationListener) listener : new GenericApplicationListenerAdapter(listener));
    return (smartListener.supportsEventType(eventType) && smartListener.supportsSourceType(sourceType));
}
项目:alfresco-repository    文件:SafeApplicationEventMulticaster.java   
/**
 * Determine whether the given listener supports the given event.
 * <p>
 * The default implementation detects the {@link SmartApplicationListener}
 * interface. In case of a standard {@link ApplicationListener}, a
 * {@link GenericApplicationListenerAdapter} will be used to introspect the
 * generically declared type of the target listener.
 * 
 * @param listener
 *            the target listener to check
 * @param eventType
 *            the event type to check against
 * @param sourceType
 *            the source type to check against
 * @return whether the given listener should be included in the candidates
 *         for the given event type
 */
protected boolean supportsEvent(ApplicationListener listener, Class<? extends ApplicationEvent> eventType,
        Class sourceType)
{

    SmartApplicationListener smartListener = (listener instanceof SmartApplicationListener ? (SmartApplicationListener) listener
            : new GenericApplicationListenerAdapter(listener));
    return (smartListener.supportsEventType(eventType) && smartListener.supportsSourceType(sourceType));
}
项目:community-edition-old    文件:SafeApplicationEventMulticaster.java   
/**
 * Determine whether the given listener supports the given event.
 * <p>
 * The default implementation detects the {@link SmartApplicationListener}
 * interface. In case of a standard {@link ApplicationListener}, a
 * {@link GenericApplicationListenerAdapter} will be used to introspect the
 * generically declared type of the target listener.
 * 
 * @param listener
 *            the target listener to check
 * @param eventType
 *            the event type to check against
 * @param sourceType
 *            the source type to check against
 * @return whether the given listener should be included in the candidates
 *         for the given event type
 */
protected boolean supportsEvent(ApplicationListener listener, Class<? extends ApplicationEvent> eventType,
        Class sourceType)
{

    SmartApplicationListener smartListener = (listener instanceof SmartApplicationListener ? (SmartApplicationListener) listener
            : new GenericApplicationListenerAdapter(listener));
    return (smartListener.supportsEventType(eventType) && smartListener.supportsSourceType(sourceType));
}