Implementation Note
An instance of this class represents both the internal (Session) and application level
(HttpSession) view of the session. However, because the class itself is not declared public, Java logic outside of
the org.apache.catalina.session package cannot cast an HttpSession view of this instance back to a
Session view.
Implementation Note
If you add fields to this class, you must make sure that you carry them over in the read/writeObject methods so that this class is properly serialized.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected transient AtomicInteger | accessCount
The access count for this session. |
| protected transient boolean | activityCheck
The activity check for this session. |
| protected ConcurrentMap | attributes
The collection of user data attributes associated with this Session. |
| protected transient String | authType
The authentication type used to authenticate our cached Principal, if any. |
| protected long | creationTime
The time this session was created, in milliseconds since midnight, January 1, 1970 GMT. |
| protected static final String[] | EMPTY_ARRAY
Type array. |
| protected transient volatile boolean | expiring
We are currently processing a session expiration, so bypass certain IllegalStateException tests. |
| protected transient StandardSessionFacade | facade
The facade associated with this session. |
| protected String | id
The session identifier of this Session. |
| protected volatile boolean | isNew
Flag indicating whether this session is new or not. |
| protected volatile boolean | isValid
Flag indicating whether this session is valid or not. |
| protected transient boolean | lastAccessAtStart
The behavior of the last access check. |
| protected volatile long | lastAccessedTime
The last accessed time for this Session. |
| protected transient ArrayList | listeners
The session event listeners for this Session. |
| protected transient Manager | manager
The Manager with which this Session is associated. |
| protected volatile int | maxInactiveInterval
The maximum time interval, in seconds, between client requests before the servlet container may invalidate this session. |
| protected transient Map | notes
Internal notes associated with this session by Catalina components and event listeners. |
| protected transient Principal | principal
The authenticated Principal associated with this session, if any Implementation Note This object is not saved and restored across session serializations! |
| private static final long | |
| protected static final StringManager | sm
The string manager for this package. |
| protected final transient PropertyChangeSupport | support
The property change support for this component. |
| protected volatile long | thisAccessedTime
The current accessed time for this session. |
| Access | Constructor and Description |
|---|---|
| public | StandardSession(Manager
The manager with which this Session is associated manager)Construct a new Session associated with the specified Manager. |
| Modifier and Type | Method and Description |
|---|---|
| public void | access()
Implements org. Update the accessed time information for this session. |
| public void | |
| public void | addSessionListener(SessionListener
the SessionListener instance that should be notified
for session events listener)Implements org. Add a session event listener to this component. |
| protected void | doReadObject(ObjectInputStream
The input stream to read from stream)Read a serialized version of this session object from the specified object input stream. |
| protected void | doWriteObject(ObjectOutputStream
The output stream to write to stream)Write a serialized version of this session object to the specified object output stream. |
| public void | |
| protected boolean | |
| public void | expire()
Implements org. Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired. |
| public void | expire(boolean
Should we notify listeners about the demise of this session? notify)Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired. |
| public void | fireSessionEvent(String
Event type type, Object Event data data)Notify all session event listeners that a particular event has occurred for this Session. |
| public Object | getAttribute(String
Name of the attribute to be returned name)Implements jakarta. Return the object bound with the specified name in this session, or |
| public Enumeration | getAttributeNames()
Implements jakarta. Return an |
| public String | getAuthType()
Implements org. Return the authentication type used to authenticate our cached Principal, if any. |
| public long | getCreationTime()
Implements jakarta. Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT. |
| public long | getCreationTimeInternal()
Implements org. Return the time when this session was created, in milliseconds since midnight, January 1, 1970 GMT, bypassing the session validation checks. |
| public String | getId()
Implements jakarta. Return the session identifier for this session. |
| public String | getIdInternal()
Implements org. Return the session identifier for this session. |
| public long | getIdleTime()
Implements org. Return the idle time (in milliseconds) from last client access time. |
| public long | getIdleTimeInternal()
Implements org. Return the idle time from last client access time without invalidation check |
| public long | getLastAccessedTime()
Implements jakarta. Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. |
| public long | getLastAccessedTimeInternal()
Implements org. Return the last client access time without invalidation check |
| public Manager | getManager()
Implements org. Return the Manager within which this Session is valid. |
| public int | getMaxInactiveInterval()
Implements jakarta. Return the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. |
| public Object | getNote(String
Name of the note to be returned name)Implements org. Return the object bound with the specified name to the internal notes for this session, or |
| public Iterator | getNoteNames()
Implements org. Return an Iterator containing the String names of all notes bindings that exist for this session. |
| private boolean | Returns: true, if authentication information shall be persisted; false otherwiseReturn whether authentication information shall be persisted or not. |
| public Principal | getPrincipal()
Implements org. Return the authenticated Principal that is associated with this Session. |
| public ServletContext | getServletContext()
Implements jakarta. Return the ServletContext to which this session belongs. |
| public HttpSession | getSession()
Implements org. Return the |
| public long | getThisAccessedTime()
Implements org. Return the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. |
| public long | getThisAccessedTimeInternal()
Implements org. Return the last client access time without invalidation check |
| public void | invalidate()
Implements jakarta. Invalidates this session and unbinds any objects bound to it. |
| public boolean | isAttributeDistributable(String
The attribute name name, Object The attribute value value)Implements org. Does the session implementation support the distributing of the given attribute? |
| public boolean | isNew()
Implements jakarta. Return |
| public boolean | |
| protected boolean | |
| protected String[] | Returns: the names of all currently defined session attributes as an array of Strings. If there are no defined attributes, a zero-length array is returned.
|
| public void | |
| public void | readObjectData(ObjectInputStream
The object input stream to read from stream)Read a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized. |
| public void | recycle()
Implements org. Release all object references, and initialize instance variables, in preparation for reuse of this object. |
| public void | removeAttribute(String
Name of the object to remove from this session. name)Implements jakarta. Remove the object bound with the specified name from this session. |
| public void | removeAttribute(String
Name of the object to remove from this session. name, boolean Should we notify interested listeners that this attribute is being removed? notify)Remove the object bound with the specified name from this session. |
| protected void | removeAttributeInternal(String
Name of the object to remove from this session. name, boolean Should we notify interested listeners that this attribute is being removed? notify)Remove the object bound with the specified name from this session. |
| public void | removeNote(String
Name of the note to be removed name)Implements org. Remove any object bound to the specified name in the internal notes for this session. |
| public void | removeSessionListener(SessionListener
remove the session listener, which will no longer be
notified listener)Implements org. Remove a session event listener from this component. |
| public void | setAttribute(String
Name to which the object is bound, cannot be null name, Object Object to be bound, cannot be null value)Implements jakarta. Bind an object to this session, using the specified name. |
| public void | setAttribute(String
Name to which the object is bound, cannot be null name, Object Object to be bound, cannot be null value, boolean whether to notify session listeners notify)Bind an object to this session, using the specified name. |
| public void | setAuthType(String
The new cached authentication type authType)Implements org. Set the authentication type used to authenticate our cached Principal, if any. |
| public void | setCreationTime(long
The new creation time time)Implements org. Set the creation time for this session. |
| public void | setId(String
The new session identifier id)Implements org. Set the session identifier for this session. |
| public void | setId(String
The new session identifier id, boolean Should any associated listeners be notified that a new
session has been created? notify)Implements org. Set the session identifier for this session and optionally notifies any associated listeners that a new session has been created. |
| public void | setManager(Manager
The new Manager manager)Implements org. Set the Manager within which this Session is valid. |
| public void | setMaxInactiveInterval(int
The new maximum interval interval)Implements jakarta. Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. |
| public void | setNew(boolean
The new value for the isNew)isNew flagImplements org. Set the |
| public void | setNote(String
Name to which the object should be bound name, Object Object to be bound to the specified name value)Implements org. Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name. |
| public void | setPrincipal(Principal
The new Principal, or principal)null if noneImplements org. Set the authenticated Principal that is associated with this Session. |
| public void | setValid(boolean
The new value for the isValid)isValid flagImplements org. Set the |
| public void | tellChangedSessionId(String
new session ID newId, String old session ID oldId, boolean Should any associated sessionListeners be notified that session ID has been
changed? notifySessionListeners, boolean Should any associated ContainerListeners be notified that session ID has been
changed? notifyContainerListeners)Implements org. Inform the listeners about the change session ID. |
| public void | |
| public String | |
| public void | writeObjectData(ObjectOutputStream
The object output stream to write to stream)Write a serialized version of the contents of this session object to the specified object output stream, without requiring that the StandardSession itself have been serialized. |