Create ExpiringSession which extends Session

This provides a better separation for consumers of the API. Most users are
likely not interested in checking to see if a session is expired so they
can focus on the Session API.

Fixes #28
This commit is contained in:
Rob Winch
2014-07-30 11:56:43 -05:00
parent f1fa380bdd
commit 903017285b
11 changed files with 73 additions and 59 deletions

View File

@@ -22,6 +22,7 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.session.ExpiringSession;
import org.springframework.session.Session;
import org.springframework.session.data.redis.RedisOperationsSessionRepository;
import org.springframework.session.web.http.SessionRepositoryFilter;
@@ -72,7 +73,7 @@ public class Config {
}
@Bean
public RedisOperationsSessionRepository sessionRepository(RedisTemplate<String, Session> redisTemplate) {
public RedisOperationsSessionRepository sessionRepository(RedisTemplate<String, ExpiringSession> redisTemplate) {
return new RedisOperationsSessionRepository(redisTemplate);
}