src/main/java/org/realityforge/ssf/InMemorySessionManager.java
/**
   * Remove sessions that have not been accessed for the specified idle time.
   *
   * @param maxIdleTime the max idle time for a session.
   * @return the number of sessions removed.
   */
Remove sessions that have not been accessed for the specified idle time.
@param maxIdleTime the max idle time for a session.
@return the number of sessions removed.
Remove sessions that have not been accessed for the specified idle time . @param maxIdleTime the max idle time for a session . @return the number of sessions removed .
protected int removeIdleSessions( final long maxIdleTime )
  {
    int removedSessions = 0;
    final long now = System.currentTimeMillis();
    _lock.writeLock().lock();
    try
    {
      final Iterator<Entry<String, T>> iterator = _sessions.entrySet().iterator();
      while ( iterator.hasNext() )
      {
        final T session = iterator.next().getValue();
        if ( now - session.getLastAccessedAt() > maxIdleTime )
        {
          iterator.remove();
          removedSessions++;
        }
      }
    }
    finally
    {
      _lock.writeLock().unlock();
    }
    return removedSessions;
  }
protected int removeIdleSessions ( final long maxIdleTime ) { int removedSessions = 0 ; final long now = System . currentTimeMillis ( ) ; _lock . writeLock ( ) . lock ( ) ; try { final Iterator < Entry < String , T > > iterator = _sessions . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { final T session = iterator . next ( ) . getValue ( ) ; if ( now - session . getLastAccessedAt ( ) > maxIdleTime ) { iterator . remove ( ) ; removedSessions ++ ; } } } finally { _lock . writeLock ( ) . unlock ( ) ; } return removedSessions ; }
Remove sessions that have not been accessed for the specified idle time.
Remove sessions that have not been accessed for the specified idle time .