435412 Make AbstractSession.access() more amenable to customization
This commit is contained in:
parent
65e13ce08f
commit
58ea1dd386
|
@ -110,6 +110,18 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
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
|
||||
public AbstractSession getSession()
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue