/** Remove session from manager * @param session The session to remove * @param invalidate True if {@link HttpSessionListener#sessionDestroyed(HttpSessionEvent)} and * {@link SessionIdManager#invalidateAll(String)} should be called. */ @Override public boolean removeSession(AbstractSession session, boolean invalidate) { // Remove session from context and global maps boolean removed = super.removeSession(session, invalidate); if (removed) { if (!invalidate) { session.willPassivate(); } } return removed; }
/** Remove session from manager * @param session The session to remove * @param invalidate True if {@link HttpSessionListener#sessionDestroyed(HttpSessionEvent)} and * {@link SessionIdManager#invalidateAll(String)} should be called. */ @Override public boolean removeSession(AbstractSession session, boolean invalidate) { // Remove session from context and global maps boolean removed = super.removeSession(session, invalidate); if (removed) { if (!invalidate) { session.willPassivate(); } } return removed; }
@Override protected final void addSession(final AbstractSession session) { if (isRunning()) { final String clusterId = getClusterId(session); sessions.put(clusterId, (Session) session); session.willPassivate(); storeSession((Session) session); session.didActivate(); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)._data); session.didActivate(); } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; _sessions.put(session.getClusterId(), (Session)session); try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)._data); session.didActivate(); } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; _sessions.put(session.getClusterId(), (Session)session); try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
/** * Add a newly created session to our in-memory list for this node and persist it. * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSession) */ @Override protected void addSession(AbstractSession session) { if (session==null) return; synchronized (this) { _sessions.put(session.getClusterId(), session); } //TODO or delay the store until exit out of session? If we crash before we store it //then session data will be lost. try { synchronized (session) { session.willPassivate(); storeSession(((JDBCSessionManager.Session)session)); session.didActivate(); } } catch (Exception e) { LOG.warn("Unable to store new session id="+session.getId() , e); } }
@Override public final void removeSession(final AbstractSession session, boolean invalidate) { final String clusterId = getClusterId(session); final boolean removed = removeSession(clusterId); if (removed) { _sessionsStats.decrement(); _sessionTimeStats.set(Math.round((System.currentTimeMillis() - session.getCreationTime()) / 1000.0)); _sessionIdManager.removeSession(session); if (invalidate) { _sessionIdManager.invalidateAll(session.getClusterId()); } if (invalidate && _sessionListeners != null) { final HttpSessionEvent event = new HttpSessionEvent(session); for (int i = LazyList.size(_sessionListeners); i-- > 0;) { ((HttpSessionListener) LazyList.get(_sessionListeners, i)).sessionDestroyed(event); } } if (!invalidate) { session.willPassivate(); } } }