Search in sources :

Example 1 with GenericApplicationListenerAdapter

use of org.springframework.context.event.GenericApplicationListenerAdapter in project spring-security by spring-projects.

the class SessionManagementConfigurer method registerDelegateApplicationListener.

private void registerDelegateApplicationListener(H http, ApplicationListener<?> delegate) {
    ApplicationContext context = http.getSharedObject(ApplicationContext.class);
    if (context == null) {
        return;
    }
    if (context.getBeansOfType(DelegatingApplicationListener.class).isEmpty()) {
        return;
    }
    DelegatingApplicationListener delegating = context.getBean(DelegatingApplicationListener.class);
    SmartApplicationListener smartListener = new GenericApplicationListenerAdapter(delegate);
    delegating.addListener(smartListener);
}
Also used : SmartApplicationListener(org.springframework.context.event.SmartApplicationListener) GenericApplicationListenerAdapter(org.springframework.context.event.GenericApplicationListenerAdapter) ApplicationContext(org.springframework.context.ApplicationContext) DelegatingApplicationListener(org.springframework.security.context.DelegatingApplicationListener)

Aggregations

ApplicationContext (org.springframework.context.ApplicationContext)1 GenericApplicationListenerAdapter (org.springframework.context.event.GenericApplicationListenerAdapter)1 SmartApplicationListener (org.springframework.context.event.SmartApplicationListener)1 DelegatingApplicationListener (org.springframework.security.context.DelegatingApplicationListener)1