OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-13 4545664bbece1b1b185945376b344b1660669a53
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package kr.wisestone.owl.config;
 
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.session.data.redis.RedisOperationsSessionRepository;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
 
/**
 * Created by jeong on 2017-08-01.
 */
@Configuration
@ComponentScan(basePackages = "kr.wisestone.owl")
@MapperScan(basePackages = "kr.wisestone.owl.mapper")
@EnableRedisHttpSession
public class AppConfiguration implements ApplicationListener {
    @Value("${spring.session.timeout}")
    private Integer maxInactiveIntervalInSeconds;
 
    @Autowired
    private RedisOperationsSessionRepository redisOperation;
 
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent) {
            redisOperation.setDefaultMaxInactiveInterval(maxInactiveIntervalInSeconds);
        }
    }
}