435412 Make AbstractSession.access() more amenable to customization

This commit is contained in:
Jan Bartel 2014-05-21 18:41:36 +02:00
parent 65e13ce08f
commit 58ea1dd386
1 changed files with 13 additions and 1 deletions

View File

@ -109,6 +109,18 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
if (_invalid)
throw new IllegalStateException();
}
/* ------------------------------------------------------------- */
/** Check to see if session has expired as at the time given.
* @param time
* @return
*/
protected boolean checkExpiry(long time)
{
if (_maxIdleMs>0 && _lastAccessed>0 && _lastAccessed + _maxIdleMs < time)
return true;
return false;
}
/* ------------------------------------------------------------- */
@Override
@ -317,7 +329,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
_lastAccessed=_accessed;
_accessed=time;
if (_maxIdleMs>0 && _lastAccessed>0 && _lastAccessed + _maxIdleMs < time)
if (checkExpiry(time))
{
invalidate();
return false;