@Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } });
@Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } });
@Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } });
static HttpSessionImpl forSession(final Session session, final ServletContext servletContext, final boolean newSession) { if (System.getSecurityManager() == null) { return HttpSessionImpl.forSession(session, servletContext, newSession); } else { return AccessController.doPrivileged(new PrivilegedAction<HttpSessionImpl>() { @Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } }); } }
static HttpSessionImpl forSession(final Session session, final ServletContext servletContext, final boolean newSession) { if (System.getSecurityManager() == null) { return HttpSessionImpl.forSession(session, servletContext, newSession); } else { return AccessController.doPrivileged(new PrivilegedAction<HttpSessionImpl>() { @Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } }); } }
static HttpSessionImpl forSession(final Session session, final ServletContext servletContext, final boolean newSession) { if (System.getSecurityManager() == null) { return HttpSessionImpl.forSession(session, servletContext, newSession); } else { return AccessController.doPrivileged(new PrivilegedAction<HttpSessionImpl>() { @Override public HttpSessionImpl run() { return HttpSessionImpl.forSession(session, servletContext, newSession); } }); } }
public static HttpSession forConvergedSession(final Session session, final ServletContext servletContext, final boolean newSession, SessionManager manager) { // forSession is called by privileged actions only so no need to do it again ServletRequestContext current = ServletRequestContext.current(); if (current == null) { return new ConvergedHttpSessionFacade(HttpSessionImpl.forSession(session, servletContext, newSession), manager); } else { HttpSessionImpl httpSession = current.getSession(); if (httpSession == null) { httpSession = HttpSessionImpl.forSession(session, servletContext, newSession); current.setSession(httpSession); } else { if(httpSession.getSession() != session) { //in some rare cases it may be that there are two different service contexts involved in the one request //in this case we just return a new session rather than using the thread local version httpSession = HttpSessionImpl.forSession(session, servletContext, newSession); } } return new ConvergedHttpSessionFacade(httpSession, manager); } }
public static HttpSession forConvergedSession(final Session session, final ServletContext servletContext, final boolean newSession, SessionManager manager) { // forSession is called by privileged actions only so no need to do it again ServletRequestContext current = ServletRequestContext.current(); if (current == null) { return new ConvergedHttpSessionFacade(HttpSessionImpl.forSession(session, servletContext, newSession), manager); } else { HttpSessionImpl httpSession = current.getSession(); if (httpSession == null) { httpSession = HttpSessionImpl.forSession(session, servletContext, newSession); current.setSession(httpSession); } else { if(httpSession.getSession() != session) { //in some rare cases it may be that there are two different service contexts involved in the one request //in this case we just return a new session rather than using the thread local version httpSession = HttpSessionImpl.forSession(session, servletContext, newSession); } } return new ConvergedHttpSessionFacade(httpSession, manager); } }