@Override protected HttpSession getSessionFromRequest(HttpServletRequest request, boolean create) { return SessionHolder.getSession(request, create); }
/** * Get the session, create equals false; * @return http session or null if no such session exists */ protected HttpSession getSessionIfExists() { return SessionHolder.getSessionIfExists(); }
public void sessionDestroyed(HttpSession session) { // Mark the session context and conversation contexts to destroy // instances when appropriate deactivateSessionDestructionContext(session); boolean destroyed = getSessionContext().destroy(session); SessionHolder.clear(); RequestScopedCache.endRequest(); if (destroyed) { // we are outside of a request (the session timed out) and therefore the session was destroyed immediately // we can fire the @Destroyed(SessionScoped.class) event immediately sessionDestroyedEvent.fire(session); } else { // the old session won't be available at the time we destroy this request // let's store its reference until then if (getRequestContext() instanceof HttpRequestContextImpl) { HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest(); request.setAttribute(HTTP_SESSION, session); } } }
public void sessionCreated(HttpSession session) { SessionHolder.sessionCreated(session); conversationContextActivator.sessionCreated(session); sessionInitializedEvent.fire(session); }
SessionHolder.requestInitialized(request);
public void sessionDestroyed(HttpSession session) { // Mark the session context and conversation contexts to destroy // instances when appropriate deactivateSessionDestructionContext(session); boolean destroyed = getSessionContext().destroy(session); SessionHolder.clear(); RequestScopedCache.endRequest(); if (destroyed) { // we are outside of a request (the session timed out) and therefore the session was destroyed immediately // we can fire the @Destroyed(SessionScoped.class) event immediately sessionDestroyedEvent.fire(session); } else { // the old session won't be available at the time we destroy this request // let's store its reference until then if (getRequestContext() instanceof HttpRequestContextImpl) { HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest(); request.setAttribute(HTTP_SESSION, session); } } }
public void sessionCreated(HttpSession session) { SessionHolder.sessionCreated(session); conversationContextActivator.sessionCreated(session); sessionInitializedEvent.fire(session); }
SessionHolder.requestInitialized(request);
/** * Get the session, create equals false; * @return http session or null if no such session exists */ protected HttpSession getSessionIfExists() { return SessionHolder.getSessionIfExists(); }
@Override protected HttpSession getSessionFromRequest(HttpServletRequest request, boolean create) { return SessionHolder.getSession(request, create); }
public void sessionDestroyed(HttpSession session) { // Mark the session context and conversation contexts to destroy // instances when appropriate deactivateSessionDestructionContext(session); boolean destroyed = getSessionContext().destroy(session); SessionHolder.clear(); RequestScopedCache.endRequest(); if (destroyed) { // we are outside of a request (the session timed out) and therefore the session was destroyed immediately // we can fire the @Destroyed(SessionScoped.class) event immediately sessionDestroyedEvent.fire(session); } else { // the old session won't be available at the time we destroy this request // let's store its reference until then if (getRequestContext() instanceof HttpRequestContextImpl) { HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest(); request.setAttribute(HTTP_SESSION, session); } } }
public void sessionCreated(HttpSession session) { SessionHolder.sessionCreated(session); conversationContextActivator.sessionCreated(session); sessionInitializedEvent.fire(session); }
SessionHolder.requestInitialized(request);
/** * Get the session, create equals false; * @return http session or null if no such session exists */ protected HttpSession getSessionIfExists() { return SessionHolder.getSessionIfExists(); }
@Override protected HttpSession getSessionFromRequest(HttpServletRequest request, boolean create) { return SessionHolder.getSession(request, create); }
SessionHolder.clear();
@Override protected void setSessionAttribute(HttpServletRequest request, String name, Object value, boolean create) { if (create || SessionHolder.getSessionIfExists() != null) { getSessionFromRequest(request, true).setAttribute(name, value); } }
@Override protected HttpSession getSession(boolean create) { try { return SessionHolder.getSession(request, create); } catch (IllegalStateException e) { // If container can't create an underlying session, invalidate the // current one detach(); return null; } }
SessionHolder.clear();
@Override protected Object getSessionAttribute(HttpServletRequest request, String name, boolean create) { if (create || SessionHolder.getSessionIfExists() != null) { return getSessionFromRequest(request, true).getAttribute(name); } else { return null; } }