|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Manager manages the pool of Sessions that are associated with a particular Container. Different Manager implementations may support value-added features such as the persistent storage of session data, as well as migrating sessions for distributable web applications.
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.
Method Summary | |
void |
add(Session session)
Add this Session to the set of active Sessions for this Manager. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
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. |
void |
changeSessionId(Session session)
Change the session ID of the current session to a new randomly generated session ID. |
Session |
createEmptySession()
Get a session from the recycled ones or create a new empty one. |
Session |
createSession()
Deprecated. |
Session |
createSession(java.lang.String sessionId)
Construct and return a new session object, based on the default settings specified by this Manager's properties. |
Session |
findSession(java.lang.String id)
Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return null . |
Session[] |
findSessions()
Return the set of active Sessions associated with this Manager. |
int |
getActiveSessions()
Gets the number of currently active sessions. |
Container |
getContainer()
Return the Container with which this Manager is associated. |
boolean |
getDistributable()
Return the distributable flag for the sessions supported by this Manager. |
int |
getExpiredSessions()
Gets the number of sessions that have expired. |
java.lang.String |
getInfo()
Return descriptive information about this Manager implementation and the corresponding version number, in the format <description>/<version> . |
int |
getMaxActive()
Gets the maximum number of sessions that have been active at the same time. |
int |
getMaxInactiveInterval()
Return the default maximum inactive interval (in seconds) for Sessions created by this Manager. |
int |
getRejectedSessions()
Gets the number of sessions that were not created because the maximum number of active sessions was reached. |
int |
getSessionAverageAliveTime()
Gets the average time (in seconds) that expired sessions had been alive. |
int |
getSessionCounter()
Returns the total number of sessions created by this manager. |
int |
getSessionIdLength()
Gets the session id length (in bytes) of Sessions created by this Manager. |
int |
getSessionMaxAliveTime()
Gets the longest time (in seconds) that an expired session had been alive. |
void |
load()
Load any currently active sessions that were previously unloaded to the appropriate persistence mechanism, if any. |
void |
remove(Session session)
Remove this Session from the active Sessions for this Manager. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setContainer(Container container)
Set the Container with which this Manager is associated. |
void |
setDistributable(boolean distributable)
Set the distributable flag for the sessions supported by this Manager. |
void |
setExpiredSessions(int expiredSessions)
Sets the number of sessions that have expired. |
void |
setMaxActive(int maxActive)
(Re)sets the maximum number of sessions that have been active at the same time. |
void |
setMaxInactiveInterval(int interval)
Set the default maximum inactive interval (in seconds) for Sessions created by this Manager. |
void |
setRejectedSessions(int rejectedSessions)
Sets the number of sessions that were not created because the maximum number of active sessions was reached. |
void |
setSessionAverageAliveTime(int sessionAverageAliveTime)
Sets the average time (in seconds) that expired sessions had been alive. |
void |
setSessionCounter(int sessionCounter)
Sets the total number of sessions created by this manager. |
void |
setSessionIdLength(int idLength)
Sets the session id length (in bytes) for Sessions created by this Manager. |
void |
setSessionMaxAliveTime(int sessionMaxAliveTime)
Sets the longest time (in seconds) that an expired session had been alive. |
void |
unload()
Save any currently active sessions in the appropriate persistence mechanism, if any. |
Method Detail |
public Container getContainer()
public void setContainer(Container container)
container
- The newly associated Containerpublic boolean getDistributable()
public void setDistributable(boolean distributable)
distributable
- The new distributable flagpublic java.lang.String getInfo()
<description>/<version>
.
public int getMaxInactiveInterval()
public void setMaxInactiveInterval(int interval)
interval
- The new default valuepublic int getSessionIdLength()
public void setSessionIdLength(int idLength)
idLength
- The session id lengthpublic int getSessionCounter()
public void setSessionCounter(int sessionCounter)
sessionCounter
- Total number of sessions created by this manager.public int getMaxActive()
public void setMaxActive(int maxActive)
maxActive
- Maximum number of sessions that have been active at
the same time.public int getActiveSessions()
public int getExpiredSessions()
public void setExpiredSessions(int expiredSessions)
expiredSessions
- Number of sessions that have expiredpublic int getRejectedSessions()
public void setRejectedSessions(int rejectedSessions)
rejectedSessions
- Number of rejected sessionspublic int getSessionMaxAliveTime()
public void setSessionMaxAliveTime(int sessionMaxAliveTime)
sessionMaxAliveTime
- Longest time (in seconds) that an expired
session had been alive.public int getSessionAverageAliveTime()
public void setSessionAverageAliveTime(int sessionAverageAliveTime)
sessionAverageAliveTime
- Average time (in seconds) that expired
sessions had been alive.public void add(Session session)
session
- Session to be addedpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to addpublic void changeSessionId(Session session)
session
- The session to change the session ID forpublic Session createEmptySession()
public Session createSession()
null
.
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reasonpublic Session createSession(java.lang.String sessionId)
null
.
sessionId
- The session id which should be used to create the
new session; if null
, the session
id will be assigned by this method, and available via the getId()
method of the returned session.
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reasonpublic Session findSession(java.lang.String id) throws java.io.IOException
null
.
id
- The session id for the session to be returned
java.lang.IllegalStateException
- if a new session cannot be
instantiated for any reason
java.io.IOException
- if an input/output error occurs while
processing this requestpublic Session[] findSessions()
public void load() throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
- if a serialized class cannot be
found during the reload
java.io.IOException
- if an input/output error occurspublic void remove(Session session)
session
- Session to be removedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to removepublic void unload() throws java.io.IOException
java.io.IOException
- if an input/output error occurspublic void backgroundProcess()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |