In order for a Manager implementation to successfully operate
with a Context implementation that implements reloading, it
must obey the following constraints:
Lifecycle so that the Context can indicate
that a restart is required.
stop() to be followed by a call to
start() on the same Manager instance.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addPropertyChangeListener(PropertyChangeListener
The listener to add listener)Add a property change listener to this component. |
| public void | backgroundProcess()
This method will be invoked by the context/container on a periodic basis and allows the manager to implement a method that executes periodic tasks, such as expiring sessions etc. |
| public void | changeSessionId(Session
The session to change the session ID for session, String new session ID newId)Change the session ID of the current session to a specified session ID. |
| public Session | Returns: An empty Session objectGet a session from the recycled ones or create a new empty one. |
| public Session | Returns: An empty Session object with the given ID or a newly created session ID if none was specifiedThe session id which should be used to create the
new session; if sessionId)null, the session
id will be assigned by this method, and available via the getId()
method of the returned session.Construct and return a new session object, based on the default settings specified by this Manager's properties. |
| public Session | Returns: the request session ornull if a session with the
requested ID could not be foundThe session id for the session to be returned id)Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return |
| public Session[] | Returns: All the currently active sessions managed by this managerReturn the set of active Sessions associated with this Manager. |
| public int | Returns: Number of currently active sessionsGets the number of currently active sessions. |
| public Context | |
| public long | Returns: Number of sessions that have expiredGets the number of sessions that have expired. |
| public int | Returns: Maximum number of sessions that have been active at the same timeGets the maximum number of sessions that have been active at the same time. |
| public default boolean | Returns: true if the listener will be notified, false if
it will notWhen an attribute that is already present in the session is added again
under the same name and a |
| public default boolean | Returns: true if the listener will be notified, false if
it will notWhen an attribute that is already present in the session is added again
under the same name and the attribute implements |
| public int | Returns: Number of rejected sessionsGets the number of sessions that were not created because the maximum number of active sessions was reached. |
| public default boolean | Returns: the flag valueIf this is |
| public int | Returns: Average time (in seconds) that expired sessions had been alive.Gets the average time (in seconds) that expired sessions had been alive. |
| public long | Returns: Total number of sessions created by this manager.Returns the total number of sessions created by this manager. |
| public int | Returns: The current rate (in sessions per minute) of session creationGets the current rate of session creation (in session per minute). |
| public int | Returns: The current rate (in sessions per minute) of session expirationGets the current rate of session expiration (in session per minute). |
| public SessionIdGenerator | |
| public default boolean | Returns: the flag valueIf this is |
| public int | Returns: Longest time (in seconds) that an expired session had been alive.Gets the longest time (in seconds) that an expired session had been alive. |
| public void | load()
Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. |
| public void | |
| public void | |
| public void | removePropertyChangeListener(PropertyChangeListener
The listener to remove listener)Remove a property change listener from this component. |
| public default String | Returns: The new session IDThe session to change the session ID for session)Change the session ID of the current session to a new randomly generated session ID. |
| public void | setContext(Context
The newly associated Context context)Set the Context with which this Manager is associated. |
| public void | setExpiredSessions(long
Number of sessions that have expired expiredSessions)Sets the number of sessions that have expired. |
| public void | setMaxActive(int
Maximum number of sessions that have been active at
the same time. maxActive)(Re)sets the maximum number of sessions that have been active at the same time. |
| public void | setNotifyAttributeListenerOnUnchangedValue(boolean
true the listener
will be called, false it will notConfigure if
|
| public void | setNotifyBindingListenerOnUnchangedValue(boolean
true the listener
will be called, false it will notConfigure if
|
| public void | setSessionActivityCheck(boolean
the new flag value sessionActivityCheck)Configure if Tomcat will track the number of active requests for each session. |
| public void | setSessionCounter(long
Total number of sessions created by this manager. sessionCounter)Sets the total number of sessions created by this manager. |
| public void | setSessionIdGenerator(SessionIdGenerator
The session id generator sessionIdGenerator)Sets the session id generator |
| public void | setSessionLastAccessAtStart(boolean
the new flag value sessionLastAccessAtStart)Configure if the last accessed time for sessions will be calculated from the beginning of the previous request. |
| public void | setSessionMaxAliveTime(int
Longest time (in seconds) that an expired
session had been alive. sessionMaxAliveTime)Sets the longest time (in seconds) that an expired session had been alive. |
| public void | |
| public boolean | Returns: true if the Manager would distribute the given attribute
otherwise falseThe attribute name name, Object The attribute value value)Would the Manager distribute the given session attribute? |
| add | back to summary |
|---|---|
| public void add(Session session) Add this Session to the set of active Sessions for this Manager.
| |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(PropertyChangeListener listener) Add a property change listener to this component.
| |
| backgroundProcess | back to summary |
|---|---|
| public void backgroundProcess() This method will be invoked by the context/container on a periodic basis and allows the manager to implement a method that executes periodic tasks, such as expiring sessions etc. | |
| changeSessionId | back to summary |
|---|---|
| public void changeSessionId(Session session, String newId) Change the session ID of the current session to a specified session ID. | |
| createEmptySession | back to summary |
|---|---|
| public Session createEmptySession() Get a session from the recycled ones or create a new empty one. The PersistentManager manager does not need to create session data because it reads it from the Store.
| |
| createSession | back to summary |
|---|---|
| public Session createSession(String sessionId) Construct and return a new session object, based on the default
settings specified by this Manager's properties. The session
id specified will be used as the session id.
If a new session cannot be created for any reason, return
| |
| findSession | back to summary |
|---|---|
| public Session findSession(String id) throws IOException Return the active Session, associated with this Manager, with the
specified session id (if any); otherwise return
| |
| findSessions | back to summary |
|---|---|
| public Session[] findSessions() Return the set of active Sessions associated with this Manager. If this Manager has no active Sessions, a zero-length array is returned.
| |
| getActiveSessions | back to summary |
|---|---|
| public int getActiveSessions() Gets the number of currently active sessions.
| |
| getContext | back to summary |
|---|---|
| public Context getContext() Get the Context with which this Manager is associated.
| |
| getExpiredSessions | back to summary |
|---|---|
| public long getExpiredSessions() Gets the number of sessions that have expired.
| |
| getMaxActive | back to summary |
|---|---|
| public int getMaxActive() Gets the maximum number of sessions that have been active at the same time.
| |
| getNotifyAttributeListenerOnUnchangedValue | back to summary |
|---|---|
| public default boolean getNotifyAttributeListenerOnUnchangedValue() When an attribute that is already present in the session is added again
under the same name and a
The default value is
| |
| getNotifyBindingListenerOnUnchangedValue | back to summary |
|---|---|
| public default boolean getNotifyBindingListenerOnUnchangedValue() When an attribute that is already present in the session is added again
under the same name and the attribute implements
The default value is
| |
| getRejectedSessions | back to summary |
|---|---|
| public int getRejectedSessions() Gets the number of sessions that were not created because the maximum number of active sessions was reached.
| |
| getSessionActivityCheck | back to summary |
|---|---|
| public default boolean getSessionActivityCheck() If this is
| |
| getSessionAverageAliveTime | back to summary |
|---|---|
| public int getSessionAverageAliveTime() Gets the average time (in seconds) that expired sessions had been alive. This may be based on sample data.
| |
| getSessionCounter | back to summary |
|---|---|
| public long getSessionCounter() Returns the total number of sessions created by this manager.
| |
| getSessionCreateRate | back to summary |
|---|---|
| public int getSessionCreateRate() Gets the current rate of session creation (in session per minute). This may be based on sample data.
| |
| getSessionExpireRate | back to summary |
|---|---|
| public int getSessionExpireRate() Gets the current rate of session expiration (in session per minute). This may be based on sample data
| |
| getSessionIdGenerator | back to summary |
|---|---|
public SessionIdGenerator getSessionIdGenerator()
| |
| getSessionLastAccessAtStart | back to summary |
|---|---|
| public default boolean getSessionLastAccessAtStart() If this is
| |
| getSessionMaxAliveTime | back to summary |
|---|---|
| public int getSessionMaxAliveTime() Gets the longest time (in seconds) that an expired session had been alive.
| |
| load | back to summary |
|---|---|
| public void load() throws ClassNotFoundException, IOException Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.
| |
| remove | back to summary |
|---|---|
| public void remove(Session session) Remove this Session from the active Sessions for this Manager.
| |
| remove | back to summary |
|---|---|
| public void remove(Session session, boolean update) Remove this Session from the active Sessions for this Manager.
| |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(PropertyChangeListener listener) Remove a property change listener from this component.
| |
| rotateSessionId | back to summary |
|---|---|
| public default String rotateSessionId(Session session) Change the session ID of the current session to a new randomly generated session ID. | |
| setContext | back to summary |
|---|---|
| public void setContext(Context context) Set the Context with which this Manager is associated. The Context must
be set to a non-null value before the Manager is first used. Multiple
calls to this method before first use are permitted. Once the Manager has
been used, this method may not be used to change the Context (including
setting a
| |
| setExpiredSessions | back to summary |
|---|---|
| public void setExpiredSessions(long expiredSessions) Sets the number of sessions that have expired.
| |
| setMaxActive | back to summary |
|---|---|
| public void setMaxActive(int maxActive) (Re)sets the maximum number of sessions that have been active at the same time.
| |
| setNotifyAttributeListenerOnUnchangedValue | back to summary |
|---|---|
| public void setNotifyAttributeListenerOnUnchangedValue(boolean notifyAttributeListenerOnUnchangedValue) Configure if
| |
| setNotifyBindingListenerOnUnchangedValue | back to summary |
|---|---|
| public void setNotifyBindingListenerOnUnchangedValue(boolean notifyBindingListenerOnUnchangedValue) Configure if
| |
| setSessionActivityCheck | back to summary |
|---|---|
| public void setSessionActivityCheck(boolean sessionActivityCheck) Configure if Tomcat will track the number of active requests for each session. When determining if a session is valid, any session with at least one active request will always be considered valid.
| |
| setSessionCounter | back to summary |
|---|---|
| public void setSessionCounter(long sessionCounter) Sets the total number of sessions created by this manager.
| |
| setSessionIdGenerator | back to summary |
|---|---|
| public void setSessionIdGenerator(SessionIdGenerator sessionIdGenerator) Sets the session id generator
| |
| setSessionLastAccessAtStart | back to summary |
|---|---|
| public void setSessionLastAccessAtStart(boolean sessionLastAccessAtStart) Configure if the last accessed time for sessions will
be calculated from the beginning of the previous request. If
| |
| setSessionMaxAliveTime | back to summary |
|---|---|
| public void setSessionMaxAliveTime(int sessionMaxAliveTime) Sets the longest time (in seconds) that an expired session had been alive.
| |
| unload | back to summary |
|---|---|
| public void unload() throws IOException Save any currently active sessions in the appropriate persistence mechanism, if any. If persistence is not supported, this method returns without doing anything.
| |
| willAttributeDistribute | back to summary |
|---|---|
| public boolean willAttributeDistribute(String name, Object value) Would the Manager distribute the given session attribute? Manager implementations may provide additional configuration options to control which attributes are distributable. | |