public class HttpSessionImpl extends Base implements javax.servlet.http.HttpSession
Base.LoggingWriter, Base.StackFrame| Constructor and Description |
|---|
HttpSessionImpl(SessionHelper helper, HttpSessionCollection collection)
Construct a Coherence HTTP session object for a new session.
|
HttpSessionImpl(SessionHelper helper, HttpSessionCollection collection, String sId)
Construct a Coherence HTTP session object for an existing session.
|
| Modifier and Type | Method and Description |
|---|---|
protected HttpSessionModel |
ensureActiveModel()
Obtain an "active" HttpSessionModel for this session.
|
protected HttpSessionModel |
ensureUsableModel()
Obtain a "usable" HttpSessionModel for this session, which may or may not be active.
|
protected void |
enter()
Ensure ownership of the session.
|
protected void |
exit()
Release ownership of the session.
|
Object |
getAttribute(String sName)
Returns the object bound with the specified name in this session, or
null if no object is bound under the name. |
Enumeration |
getAttributeNames()
Returns an
Enumeration of String objects containing the names of all the objects bound to this session. |
protected HttpSessionCollection |
getCollection()
Obtain the HttpSessionCollection.
|
long |
getCreationTime()
Returns the creation time for this session.
|
protected String |
getDescription()
Returns a string representation of this object's attributes.
|
String |
getId()
Returns the session identifier for this session.
|
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT.
|
int |
getMaxInactiveInterval()
Returns the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
|
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext to which this session belongs.
|
javax.servlet.http.HttpSessionContext |
getSessionContext()
Deprecated.
As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API.
|
protected SessionHelper |
getSessionHelper()
Get the SessionHelper for this ServletContext wrapper.
|
Object |
getValue(String sName)
Deprecated.
As of Version 2.2, this method is replaced by
getAttribute(String). |
String[] |
getValueNames()
Deprecated.
As of Version 2.2, this method is replaced by
getAttributeNames() |
void |
invalidate()
Invalidates this session then unbinds any objects bound to it.
|
boolean |
isNew()
Returns
true if the client does not yet know about the session or if the client chooses not to join the session. |
void |
putValue(String sName, Object oValue)
Deprecated.
As of Version 2.2, this method is replaced by
setAttribute(String, Object) |
void |
removeAttribute(String sName)
Removes the object bound with the specified name from this session.
|
void |
removeValue(String sName)
Deprecated.
As of Version 2.2, this method is replaced by
removeAttribute(String) |
void |
setAttribute(String sName, Object oValue)
Binds an object to this session, using the name specified.
|
void |
setMaxInactiveInterval(int cSeconds)
Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.
|
String |
toString()
Returns a string representation of the object.
|
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, waitpublic HttpSessionImpl(SessionHelper helper, HttpSessionCollection collection)
helper - the application's session helpercollection - the HttpSessionCollection that this session will use to create and manage its session modelpublic HttpSessionImpl(SessionHelper helper, HttpSessionCollection collection, String sId)
helper - the application's session helpercollection - the HttpSessionCollection that this session will use to access and manage its session modelsId - the session ID that this session will representpublic Object getAttribute(String sName)
null if no object is bound under the name.getAttribute in interface javax.servlet.http.HttpSessionsName - a string specifying the name of the objectIllegalStateException - if this method is called on an invalidated sessionpublic Enumeration getAttributeNames()
Enumeration of String objects containing the names of all the objects bound to this session.getAttributeNames in interface javax.servlet.http.HttpSessionEnumeration of String objects specifying the names of all the objects bound to this sessionIllegalStateException - if this method is called on an invalidated sessionpublic long getCreationTime()
getCreationTime in interface javax.servlet.http.HttpSessionpublic String getId()
getId in interface javax.servlet.http.HttpSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface javax.servlet.http.HttpSessionpublic int getMaxInactiveInterval()
getMaxInactiveInterval in interface javax.servlet.http.HttpSessionpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.http.HttpSessionpublic javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext in interface javax.servlet.http.HttpSessionpublic Object getValue(String sName)
getAttribute(String).null if no object is bound under the name.getValue in interface javax.servlet.http.HttpSessionsName - a string specifying the name of the objectIllegalStateException - if this method is called on an invalidated sessionpublic String[] getValueNames()
getAttributeNames()String objects specifying the names of all the objects bound to this session.getValueNames in interface javax.servlet.http.HttpSessionString objects specifying the names of all the objects bound to this sessionIllegalStateException - if this method is called on an invalidated sessionpublic void invalidate()
invalidate in interface javax.servlet.http.HttpSessionIllegalStateException - if this method is called on an already invalidated sessionpublic boolean isNew()
true if the client does not yet know about the session or if the client chooses not to join the session. For example, if the server used only cookie-based sessions, and the client had disabled the use of cookies, then a session would be new on each request.isNew in interface javax.servlet.http.HttpSessiontrue if the server has created a session, but the client has not yet joinedIllegalStateException - if this method is called on an already invalidated sessionpublic void putValue(String sName, Object oValue)
setAttribute(String, Object)If the value passed in is null, this has the same effect as calling removeAttribute().
putValue in interface javax.servlet.http.HttpSessionsName - the name to which the object is bound; cannot be nulloValue - the object to be bound; cannot be nullIllegalStateException - if this method is called on an invalidated sessionpublic void removeAttribute(String sName)
removeAttribute in interface javax.servlet.http.HttpSessionsName - the name of the object to remove from this sessionIllegalStateException - if this method is called on an invalidated sessionpublic void removeValue(String sName)
removeAttribute(String)removeValue in interface javax.servlet.http.HttpSessionsName - the name of the object to remove from this sessionIllegalStateException - if this method is called on an invalidated sessionpublic void setAttribute(String sName, Object oValue)
If the value passed in is null, this has the same effect as calling removeAttribute().
setAttribute in interface javax.servlet.http.HttpSessionsName - the name to which the object is bound; cannot be nulloValue - the object to be boundIllegalStateException - if this method is called on an invalidated sessionpublic void setMaxInactiveInterval(int cSeconds)
setMaxInactiveInterval in interface javax.servlet.http.HttpSessioncSeconds - the new maximum intervalpublic String toString()
protected String getDescription()
protected HttpSessionModel ensureUsableModel()
IllegalStateException - if a usable model cannot be obtained, for example if the session ID does not exist in the clusterprotected HttpSessionModel ensureActiveModel()
IllegalStateException - if a usable model cannot be obtained, for example if the session ID does not exist in the clusterprotected void enter()
protected void exit()
protected SessionHelper getSessionHelper()
protected HttpSessionCollection getCollection()