Make JDK 1.5 compatible
Fixes gh-71
This commit is contained in:
@@ -44,7 +44,6 @@ import com.hazelcast.core.HazelcastInstance;
|
||||
public class Initializer implements ServletContextListener {
|
||||
private HazelcastInstance instance;
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
String sessionMapName = "spring:session:sessions";
|
||||
ServletContext sc = sce.getServletContext();
|
||||
@@ -66,11 +65,10 @@ public class Initializer implements ServletContextListener {
|
||||
Map<String,ExpiringSession> sessions = instance.getMap(sessionMapName);
|
||||
|
||||
SessionRepository<ExpiringSession> sessionRepository = new MapSessionRepository(sessions);
|
||||
Dynamic fr = sc.addFilter("springSessionFilter", new SessionRepositoryFilter<>(sessionRepository ));
|
||||
Dynamic fr = sc.addFilter("springSessionFilter", new SessionRepositoryFilter<ExpiringSession>(sessionRepository ));
|
||||
fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
instance.shutdown();
|
||||
}
|
||||
|
||||
@@ -34,12 +34,10 @@ import org.springframework.session.web.http.HttpSessionManager;
|
||||
|
||||
public class UserAccountsFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
@@ -54,7 +52,7 @@ public class UserAccountsFilter implements Filter {
|
||||
String newSessionAlias = String.valueOf(System.currentTimeMillis());
|
||||
|
||||
String contextPath = req.getContextPath();
|
||||
List<Account> accounts = new ArrayList<>();
|
||||
List<Account> accounts = new ArrayList<Account>();
|
||||
Account currentAccount = null;
|
||||
for(Map.Entry<String, String> entry : sessionIds.entrySet()) {
|
||||
String alias = entry.getKey();
|
||||
@@ -88,7 +86,6 @@ public class UserAccountsFilter implements Filter {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user