public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { __log.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { __log.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { LOG.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { __log.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { __log.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { __log.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { LOG.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { __log.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { LOG.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { LOG.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { LOG.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { LOG.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
@Override public AbstractSession getSession(String idInCluster) { if ( _lazyLoad && !_sessionsLoaded) { try { restoreSessions(); } catch(Exception e) { LOG.warn(e); } } Map<String,HashedSession> sessions=_sessions; if (sessions==null) return null; HashedSession session = sessions.get(idInCluster); if (session == null && _lazyLoad) session=restoreSession(idInCluster); if (session == null) return null; if (_idleSavePeriodMs!=0) session.deIdle(); return session; }
public void restoreSessions () throws Exception { _sessionsLoaded = true; if (_storeDir==null || !_storeDir.exists()) { return; } if (!_storeDir.canRead()) { LOG.warn ("Unable to restore Sessions: Cannot read from Session storage directory "+_storeDir.getAbsolutePath()); return; } String[] files = _storeDir.list(); for (int i=0;files!=null&&i<files.length;i++) { restoreSession(files[i]); } }
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(); } } }
_hashSessionManager.restoreSession(fis, this); IO.close(fis);