@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
/** * Set a new id for this session.<br/> * Before setting the new id, it removes itself from the associated * manager. After the new id is set, this session adds itself to the * session manager. * * @param id * the new session id */ protected void setIdForRelocate( final String id ) { if ( this.id == null ) { throw new IllegalStateException( "There's no session id set." ); } if ( this.manager == null ) { throw new IllegalStateException( "There's no manager set." ); } /* * and mark it as a node-failure-session, so that remove(session) does * not try to remove it from memcached... (the session is removed and * added when the session id is changed) */ setNote( MemcachedSessionService.NODE_FAILURE, Boolean.TRUE ); manager.remove( this ); removeNote( MemcachedSessionService.NODE_FAILURE ); this.id = id; manager.add( this ); }
/** * {@inheritDoc} */ @Override public void setId(String id, boolean notify) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); if (notify) { tellNew(); } }
/** * Set the session identifier for this session. * * @param id The new session identifier */ public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); tellNew(); }
/** * {@inheritDoc} */ @Override public void setId(String id, boolean notify) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); if (notify) { tellNew(); } }
/** * Set the session identifier for this session. * * @param id The new session identifier */ public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); tellNew(); }
/** * {@inheritDoc} */ @Override public void setId(String id, boolean notify) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); if (notify) { tellNew(); } }
/** * Set the session identifier for this session. * * @param id The new session identifier */ @Override public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); tellNew(); }
/** * Set the session identifier for this session. * * @param id The new session identifier */ @Override public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); tellNew(); }
/** * {@inheritDoc} */ @Override public void setId(String id, boolean notify) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); if (notify) { tellNew(); } }
/** * Set the session identifier for this session. * * @param id The new session identifier */ @Override public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); tellNew(); }
/** * {@inheritDoc} */ @Override public void setId(String id, boolean notify) { if ((this.id != null) && (manager != null)) manager.remove(this); this.id = id; if (manager != null) manager.add(this); if (notify) { tellNew(); } }
@Override public void setValid(boolean isValid) { this.isValid = isValid; if (!isValid) { String keys[] = keys(); for (String key : keys) { removeAttributeInternal(key, false); } getManager().remove(this); } }
/** * Set a new id for this session.<br/> * Before setting the new id, it removes itself from the associated * manager. After the new id is set, this session adds itself to the * session manager. * * @param id * the new session id */ protected void setIdForRelocate( final String id ) { if ( this.id == null ) { throw new IllegalStateException( "There's no session id set." ); } if ( this.manager == null ) { throw new IllegalStateException( "There's no manager set." ); } /* * and mark it as a node-failure-session, so that remove(session) does * not try to remove it from memcached... (the session is removed and * added when the session id is changed) */ setNote( MemcachedSessionService.NODE_FAILURE, Boolean.TRUE ); manager.remove( this ); removeNote( MemcachedSessionService.NODE_FAILURE ); this.id = id; manager.add( this ); }
/** * Set the session identifier for this session. * * @param id The new session identifier */ public void setId(String id) { if ((this.id != null) && (manager != null)) manager.remove(this); String oldId = this.id; this.id = id; if (manager != null) manager.add(this); if (oldId == null) { tellNew(); } else { // Notify interested session event listeners fireSessionEvent(Session.SESSION_ID_CHANGED_EVENT, oldId); } }
manager.remove(this);
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }