AbstractSessionCache.PlaceHolderSessionpublic class Session
extends java.lang.Object
Created: 2017. 6. 13.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Session.State |
state of the session: valid, invalid or being invalidated
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
Session(SessionHandler sessionHandler,
SessionData sessionData) |
|
protected |
Session(SessionHandler sessionHandler,
SessionData sessionData,
boolean newSession) |
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
access(long time) |
|
protected boolean |
beginInvalidate() |
|
protected void |
checkLocked() |
|
protected void |
checkValidForRead() |
Check that the session data can be read.
|
protected void |
checkValidForWrite() |
Check that the session can be modified.
|
protected void |
complete() |
|
protected void |
finishInvalidate() |
|
<T> T |
getAttribute(java.lang.String name) |
|
java.util.Enumeration<java.lang.String> |
getAttributeNames() |
|
long |
getCreationTime() |
|
java.lang.String |
getId() |
|
long |
getLastAccessedTime() |
|
int |
getMaxInactiveInterval() |
|
long |
getRequests() |
Returns the current number of requests that are active in the Session.
|
SessionData |
getSessionData() |
|
protected SessionScope |
getSessionScope() |
|
void |
invalidate() |
Called by users to invalidate a session, or called by the
access method as a request enters the session if the session
has expired, or called by manager as a result of scavenger
expiring session.
|
protected boolean |
isExpiredAt(long time) |
Check to see if session has expired as at the time given.
|
protected boolean |
isIdleLongerThan(int sec) |
Check if the Session has been idle longer than a number of seconds.
|
boolean |
isNew() |
|
protected boolean |
isResident() |
|
boolean |
isValid() |
|
Locker.Lock |
lock() |
Grab the lock on the session.
|
Locker.Lock |
lockIfNotHeld() |
Grab the lock on the session if it isn't locked already.
|
void |
removeAttribute(java.lang.String name) |
|
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
|
void |
setMaxInactiveInterval(int secs) |
|
protected void |
setResident(boolean resident) |
|
protected void |
stopInactivityTimer() |
Stop the session inactivity timer.
|
java.lang.String |
toString() |
|
void |
updateInactivityTimer() |
Set the inactivity timer to the smaller of the session maxInactivity
(ie session-timeout from web.xml), or the inactive eviction time.
|
protected Session(SessionHandler sessionHandler, SessionData sessionData)
protected Session(SessionHandler sessionHandler, SessionData sessionData, boolean newSession)
public java.lang.String getId()
public SessionData getSessionData()
protected SessionScope getSessionScope()
public <T> T getAttribute(java.lang.String name)
public void setAttribute(java.lang.String name,
java.lang.Object value)
public java.util.Enumeration<java.lang.String> getAttributeNames()
public void removeAttribute(java.lang.String name)
public long getCreationTime()
public long getLastAccessedTime()
public int getMaxInactiveInterval()
public void setMaxInactiveInterval(int secs)
public void updateInactivityTimer()
protected void stopInactivityTimer()
public void invalidate()
protected boolean beginInvalidate()
protected void finishInvalidate()
public boolean isNew()
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic boolean isValid()
protected boolean isResident()
protected void setResident(boolean resident)
protected boolean isExpiredAt(long time)
time - the time since the epoch in msprotected boolean isIdleLongerThan(int sec)
sec - the number of secondsprotected void checkValidForWrite()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the session is invalidprotected void checkValidForRead()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the session is invalidprotected void checkLocked()
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic Locker.Lock lock()
public Locker.Lock lockIfNotHeld()
protected boolean access(long time)
protected void complete()
public long getRequests()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2018 The Aspectran Project. All rights reserved.