/** * {@code HazelcastHttpSession instance} creation is split off to a separate method to allow subclasses to return a * customized / extended version of {@code HazelcastHttpSession}. * * @param id the session id * @param originalSession the original session * @return a new HazelcastHttpSession instance */ protected HazelcastHttpSession createHazelcastHttpSession(String id, HttpSession originalSession) { return new HazelcastHttpSession(this, id, originalSession, config.isDeferredWrite(), config.isStickySession(), config.getTransientAttributes()); }
/** * {@code HazelcastHttpSession instance} creation is split off to a separate method to allow subclasses to return a * customized / extended version of {@code HazelcastHttpSession}. * * @param id the session id * @param originalSession the original session * @return a new HazelcastHttpSession instance */ protected HazelcastHttpSession createHazelcastHttpSession(String id, HttpSession originalSession) { return new HazelcastHttpSession(this, id, originalSession, config.isDeferredWrite(), config.isStickySession(), config.getTransientAttributes()); }
@Override public final void doFilter(ServletRequest req, ServletResponse res, final FilterChain chain) throws IOException, ServletException { HazelcastRequestWrapper requestWrapper = new HazelcastRequestWrapper((HttpServletRequest) req, (HttpServletResponse) res); chain.doFilter(requestWrapper, res); HazelcastHttpSession session = requestWrapper.getSession(false); if (session != null && session.isValid() && config.isDeferredWrite()) { if (LOGGER.isFinestEnabled()) { LOGGER.finest("UPDATING SESSION " + session.getId()); } session.sessionDeferredWrite(); } }
@Override public final void doFilter(ServletRequest req, ServletResponse res, final FilterChain chain) throws IOException, ServletException { HazelcastRequestWrapper requestWrapper = new HazelcastRequestWrapper((HttpServletRequest) req, (HttpServletResponse) res); chain.doFilter(requestWrapper, res); HazelcastHttpSession session = requestWrapper.getSession(false); if (session != null && session.isValid() && config.isDeferredWrite()) { if (LOGGER.isFinestEnabled()) { LOGGER.finest("UPDATING SESSION " + session.getId()); } session.sessionDeferredWrite(); } }