真特征融合
2016-11-26 18:47:01 0 举报
融合
作者其他创作
大纲/内容
内部类 RedisSession
接口ExpiringSession
+ getCreationTime- setLastAccessedTime- getLastAccessedTime-setMaxInactiveIntervalInSeconds-getMaxInactiveIntervalInSeconds-isExpired
类RedisHttpSessionConfiguration
+ Integer maxInactiveIntervalInSeconds = 18000+ RedisSerializer defaultRedisSerializer;
+ RedisMessageListenerContainer redisMessageListenerContainer- 注入bean:sessionRedisTemplate- 注入bean:RedisOperationsSessionRepository sessionRepository-注入:springSessionDefaultRedisSerializer,springSessionRedisTaskExecutor,springSessionRedisSubscriptionExecutor
类 CookieHttpSessionStrategy
+ CookieSerializer cookieSerializer = new DefaultCookieSerializer();+String deserializationDelimiter = DEFAULT_DELIMITER;- String serializationDelimiter = DEFAULT_DELIMITER;
类DefaultCookieSerializer
+ String cookieName = \"SESSION\";+ Boolean useSecureCookie;- boolean useHttpOnlyCookie = isServlet3();- String cookiePath;- int cookieMaxAge = -1;- String domainName;- Pattern domainNamePattern;- String jvmRoute;-boolean useBase64Encoding;- String rememberMeRequestAttribute;
+ List readCookieValues(HttpServletRequest request)- writeCookieValue(CookieValue cookieValue) - String base64Decode(String base64Value)- String base64Encode(String value)- getter and setter;
final类 MapSession
+ T getAttribute(String attributeName)- Set getAttributeNames()- void setAttribute;-removeAttribute();
类RedisOperationsSessionRepository
+ Integer defaultMaxInactiveInterval; // 如果不为空,覆盖默认值30分钟;+ String keyPrefix = \"spring:session:\"// redis key的前缀+ final RedisSerializer defaultSerializer = new JdkSerializationRedisSerializer();- final RedisSessionExpirationPolicy expirationPolicy;
+ void cleanupExpiredSessions();// @Scheduled(cron = \"${spring.session.cleanup.cron.expression:0 * * * * *}\
抽象类 OncePerRequestFilter
+String alreadyFilteredAttributeName
+ doFilter() // 判断request是否已经过滤,没则添加过滤标识执行doFilterInternal()方法。- doFilterInternal()// 抽象方法
类SpringHttpSessionConfiguration
+ HttpSessionStrategy httpSessionStrategy = new CookieHttpSessionStrategy();+ boolean usesSpringSessionRememberMeServices;-CookieSerializer cookieSerializer;-List httpSessionListeners ;
+ init(); // 初始化CookieSerializer- 注入bean:SessionRepositoryFilter springSessionRepositoryFilter;- 注入bean:SessionEventHttpSessionListenerAdapter sessionEventHttpSessionListenerAdapter;
类RedisSessionExpirationPolicy // 处理失效session类
+ onDelete- onExpirationUpdated- getExpirationKey- getSessionKey- cleanExpiredSessions
类SessionRepositoryFilter
+ final SessionRepository sessionRepository;+ MultiHttpSessionStrategy httpSessionStrategy = new CookieHttpSessionStrategy()
+ doFilterInternal() // 将request和response进行包装,向request中添加session,最后commitSession()提交session;- private void commitSession();// 获取从redis中session,保存session到redis
0 条评论
下一页