|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.session.SessionImpl
public class SessionImpl
Implements a HTTP session.
| Field Summary | |
|---|---|
protected SessionManager |
_manager
|
protected java.util.Map<java.lang.String,java.lang.Object> |
_values
|
| Constructor Summary | |
|---|---|
SessionImpl(SessionManager manager,
java.lang.String id,
long creationTime)
Create a new session object. |
|
| Method Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
createValueMap()
Create the map used to objectStore values. |
void |
finishRequest()
Cleaning up session stuff at the end of a request. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attribute from the session. |
java.util.Enumeration |
getAttributeNames()
Return an enumeration of all the sessions' attribute names. |
long |
getCreationTime()
Returns the time the session was created. |
java.lang.String |
getId()
Returns the session identifier. |
long |
getLastAccessedTime()
Returns the last objectAccess time. |
SessionManager |
getManager()
Returns the session manager. |
int |
getMaxInactiveInterval()
Returns the time the session is allowed to be alive. |
ServletContext |
getServletContext()
Returns the servlet context. |
HttpSessionContext |
getSessionContext()
Deprecated. |
java.lang.Object |
getValue(java.lang.String name)
Deprecated. |
java.lang.String[] |
getValueNames()
Deprecated. |
boolean |
inUse()
Returns true if the session is in use. |
void |
invalidate()
Invalidates the session, called by user code. |
void |
invalidateLogout()
Invalidates a session based on a logout. |
void |
invalidateRemote()
Invalidates the session, called by user code. |
boolean |
isEmpty()
Returns true if the session is empty. |
boolean |
isNew()
Returns true if the session is new. |
boolean |
isValid()
Returns true if the session is valid. |
boolean |
load(boolean isNew)
Loads the session. |
void |
load(SessionDeserializer in)
Loads the object from the input stream. |
void |
passivate()
Passivates the session. |
void |
putValue(java.lang.String name,
java.lang.Object value)
Deprecated. |
void |
removeAttribute(java.lang.String name)
Remove a session attribute. |
void |
removeEvent()
Callback when the session is removed from the session cache, generally because the session cache is full. |
void |
removeValue(java.lang.String name)
Deprecated. |
void |
save()
Saves changes to the session. |
void |
saveAfterRequest()
Flush changes after a request completes. |
void |
saveBeforeFlush()
Save changes before any flush. |
void |
saveBeforeHeaders()
Flush changes before the headers. |
void |
setAccessTime(long now)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a session attribute. |
void |
setMaxInactiveInterval(int value)
Sets the maximum time a session is allowed to be alive. |
void |
store(SessionSerializer out)
Saves the object to the input stream. |
void |
timeout()
Called by the session manager for a session timeout |
java.lang.String |
toString()
|
void |
unbind()
Cleans up the session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected SessionManager _manager
protected java.util.Map<java.lang.String,java.lang.Object> _values
| Constructor Detail |
|---|
public SessionImpl(SessionManager manager,
java.lang.String id,
long creationTime)
manager - the owning session manager.id - the session identifier.creationTime - the time in milliseconds when the session was created.| Method Detail |
|---|
protected java.util.Map<java.lang.String,java.lang.Object> createValueMap()
public long getCreationTime()
getCreationTime in interface HttpSessionpublic java.lang.String getId()
getId in interface HttpSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface HttpSessionpublic void setMaxInactiveInterval(int value)
setMaxInactiveInterval in interface HttpSessionvalue - time allowed to live in secondspublic HttpSessionContext getSessionContext()
getSessionContext in interface HttpSessionpublic ServletContext getServletContext()
getServletContext in interface HttpSessionpublic SessionManager getManager()
public boolean isNew()
isNew in interface HttpSessionpublic boolean isValid()
public boolean isEmpty()
public boolean inUse()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface HttpSessionname - of the attribute.
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface HttpSessionname - the name of the attributevalue - the value of the attributepublic void removeAttribute(java.lang.String name)
removeAttribute in interface HttpSessionname - the name of the attribute to objectRemovepublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface HttpSessionpublic java.lang.Object getValue(java.lang.String name)
getValue in interface HttpSession
public void putValue(java.lang.String name,
java.lang.Object value)
putValue in interface HttpSessionpublic void removeValue(java.lang.String name)
removeValue in interface HttpSessionpublic java.lang.String[] getValueNames()
getValueNames in interface HttpSessionpublic void setAccessTime(long now)
public void finishRequest()
If the session data has changed and we have persistent sessions, save the session. However, if save-on-shutdown is true, only save on a server shutdown.
public boolean load(boolean isNew)
public void load(SessionDeserializer in)
throws java.io.IOException
java.io.IOExceptionpublic final void saveBeforeFlush()
public final void saveBeforeHeaders()
public final void saveAfterRequest()
public final void save()
public void passivate()
public void store(SessionSerializer out)
throws java.io.IOException
java.io.IOExceptionpublic void invalidate()
invalidate in interface HttpSessionpublic void timeout()
public void removeEvent()
removeEvent in interface CacheListenerpublic void invalidateLogout()
public void invalidateRemote()
public void unbind()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||