Java 类org.springframework.boot.context.embedded.ServletListenerRegistrationBean 实例源码

项目:pebble-spring-boot-starter    文件:WebListenerHandler.java   
@Override
protected void doHandle(Map<String, Object> attributes, BeanDefinition beanDefinition,
        BeanDefinitionRegistry registry) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ServletListenerRegistrationBean.class);
    builder.addPropertyValue("listener", beanDefinition);
    registry.registerBeanDefinition(beanDefinition.getBeanClassName(), builder.getBeanDefinition());
}
项目:x-pipe    文件:CatConfig.java   
@Bean
public ServletListenerRegistrationBean<CatListener> catListener() {

    ServletListenerRegistrationBean<CatListener> bean = new ServletListenerRegistrationBean<CatListener>(
            new CatListener());
    bean.setName("cat-listener");
    return bean;
}
项目:contestparser    文件:WebListenerHandler.java   
@Override
protected void doHandle(Map<String, Object> attributes, BeanDefinition beanDefinition,
        BeanDefinitionRegistry registry) {
    BeanDefinitionBuilder builder = BeanDefinitionBuilder
            .rootBeanDefinition(ServletListenerRegistrationBean.class);
    builder.addPropertyValue("listener", beanDefinition);
    registry.registerBeanDefinition(beanDefinition.getBeanClassName(),
            builder.getBeanDefinition());
}
项目:contestparser    文件:EmbeddedServletContainerServletContextListenerTests.java   
private void registeredServletContextListenerBeanIsCalled(Class<?> configuration) {
    AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext(
            ServletListenerRegistrationBeanConfiguration.class, configuration);
    ServletContextListener servletContextListener = (ServletContextListener) context
            .getBean("registration", ServletListenerRegistrationBean.class)
            .getListener();
    verify(servletContextListener).contextInitialized(any(ServletContextEvent.class));
    context.close();
}
项目:MaritimeCloudPortalTestbed    文件:ApplicationConfig.java   
@Bean
public ServletListenerRegistrationBean shiroServletListenerRegistrationBean() {
    ServletListenerRegistrationBean registrationBean = new ServletListenerRegistrationBean();
    EnvironmentLoaderListener environmentLoaderListener = new EnvironmentLoaderListener();
    registrationBean.setListener(environmentLoaderListener);
    registrationBean.setOrder(0);
    return registrationBean;
}
项目:apollo-custom    文件:AuthConfiguration.java   
@Bean
public ServletListenerRegistrationBean redisAppSettingListner() {
  ServletListenerRegistrationBean redisAppSettingListener = new ServletListenerRegistrationBean();
  redisAppSettingListener.setListener(listener("org.jasig.cas.client.credis.CRedisAppSettingListner"));
  return redisAppSettingListener;
}
项目:apollo    文件:AuthConfiguration.java   
@Bean
public ServletListenerRegistrationBean redisAppSettingListner() {
  ServletListenerRegistrationBean redisAppSettingListener = new ServletListenerRegistrationBean();
  redisAppSettingListener.setListener(listener("org.jasig.cas.client.credis.CRedisAppSettingListner"));
  return redisAppSettingListener;
}
项目:Voting_2b    文件:Application.java   
@Bean
public ServletListenerRegistrationBean<ConfigureListener> jsfConfigureListener() {
    return new ServletListenerRegistrationBean<ConfigureListener>(
            new ConfigureListener());
}
项目:spring-security-stateless    文件:AppConfig.java   
@Bean
ServletListenerRegistrationBean<HttpSessionListener> httpSessionCreatedListener() {
    ServletListenerRegistrationBean<HttpSessionListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>();
    listenerRegistrationBean.setListener(new HttpSessionCreatedListener());
    return listenerRegistrationBean;
}
项目:citizenship-appointment-server    文件:AppConfig.java   
@Bean
public ServletListenerRegistrationBean<HttpSessionListener> sessionCreatedListener() {
    ServletListenerRegistrationBean<HttpSessionListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>();
    listenerRegistrationBean.setListener(new HttpSessionCreatedListener());
    return listenerRegistrationBean;
}
项目:contestparser    文件:EmbeddedServletContainerServletContextListenerTests.java   
@Bean
public ServletListenerRegistrationBean<ServletContextListener> registration() {
    return new ServletListenerRegistrationBean<ServletContextListener>(
            mock(ServletContextListener.class));
}
项目:enhanced-pet-clinic    文件:MultiHttpSecurityConfig.java   
@Bean
public static ServletListenerRegistrationBean<HttpSessionEventPublisher> httpSessionEventPublisher() {
    return new ServletListenerRegistrationBean<HttpSessionEventPublisher>(new HttpSessionEventPublisher());
}
项目:spring-boot-jee-web-example    文件:JeeComponentsBeanFactoryPostProcessor.java   
private void createAndRegisterWebListenerBean(DefaultListableBeanFactory beanFactory, BeanDefinition bd,
        Class<?> beanClass, WebListener webListener) {

    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ServletListenerRegistrationBean.class);
    builder.addPropertyValue("listener", bd);

    String beanName = StringUtils.uncapitalize(beanClass.getSimpleName());

    beanFactory.registerBeanDefinition(beanName, builder.getBeanDefinition());
}
项目:whisper    文件:ApplicationSecurity.java   
@Bean
public ServletListenerRegistrationBean<HttpSessionEventPublisher> httpSessionEventPublisher() {
    return new ServletListenerRegistrationBean<HttpSessionEventPublisher>(new HttpSessionEventPublisher());
}