@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
@Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); }
file = new File(_hashSessionManager._storeDir, super.getId()); if (file.exists()) file.delete();
public synchronized void deIdle() { if (isIdled()) { // Access now to prevent race with idling period access(System.currentTimeMillis()); if (LOG.isDebugEnabled()) LOG.debug("De-idling " + super.getId()); FileInputStream fis = null; try { File file = new File(_hashSessionManager._storeDir, super.getId()); if (!file.exists() || !file.canRead()) throw new FileNotFoundException(file.getName()); fis = new FileInputStream(file); _idled = false; _hashSessionManager.restoreSession(fis, this); didActivate(); // If we are doing period saves, then there is no point deleting at this point if (_hashSessionManager._savePeriodMs == 0) file.delete(); } catch (Exception e) { LOG.warn("Problem de-idling session " + super.getId(), e); IO.close(fis); invalidate(); } } }
/** * 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; _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; 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); } }
synchronized void save(boolean reactivate) throws Exception { // Only idle the session if not already idled and no previous save/idle has failed if (!isIdled() && !_saveFailed) { if (LOG.isDebugEnabled()) LOG.debug("Saving {} {}",super.getId(),reactivate); try { willPassivate(); save(); if (reactivate) didActivate(); else clearAttributes(); } catch (Exception e) { LOG.warn("Problem saving session " + super.getId(), e); _idled=false; // assume problem was before _values.clear(); } } }
/** * 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); } }
synchronized void save(boolean reactivate) throws Exception { // Only idle the session if not already idled and no previous save/idle has failed if (!isIdled() && !_saveFailed) { if (LOG.isDebugEnabled()) LOG.debug("Saving {} {}",super.getId(),reactivate); try { willPassivate(); save(); if (reactivate) didActivate(); else clearAttributes(); } catch (Exception e) { LOG.warn("Problem saving session " + super.getId(), e); _idled=false; // assume problem was before _values.clear(); } } }
public ISerializableSession create(AbstractSession session) { synchronized(session) { ISerializableSession s = create(session.getId(), session.getCreationTime(), session.getAccessed()); if (session.isValid()) { for (String key: session.getNames()) { s.setAttribute(key, session.getAttribute(key)); } } else { // we do not need to retrieve attributes of invalidated sessions since // they have been cleared on AbstractSession.invalidate(). s.setValid(false); } return s; } }