|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.jserv.JServServletManager
Class that encapsulates the loading and managing of servlets per servlet zone.
Note about synchronization :
All the method that modifies the servlet table are synchronized on the JServServletManager. Since this table is private there no needs to synchronized on it anymore.
Inner Class Summary | |
(package private) class |
JServServletManager.ACLObjectInputStream
When deserializing the sessions during a class loader reload, override the resolveClass() method so that it uses the AdaptiveClassLoader to deserialize the sessions. |
Field Summary | |
(package private) boolean |
checkClasses
Determines whether to check the classes for changes. |
(package private) boolean |
checkFile
Determines wheter to check the property file for changes. |
protected java.io.File |
confFile
The file that contains the servlet properties. |
protected Configurations |
confs
The configurations containing information for these servlets. |
protected java.util.Properties |
defaultArgs
The default init arguments for all the servlets in this name space. |
(package private) long |
destroyTimeout
The amount of time to wait before giving up on lock when destroying servlet. |
(package private) long |
initTimeout
The amount of time to wait before giving up on lock when initializing a servlet. |
protected long |
lastInitialization
The time of the last initialization. |
private static long |
lastTimeVal
|
protected AdaptiveClassLoader |
loader
The class loader used for loading new servlets |
static long |
maxRandomLen
|
static long |
maxSessionLifespanTics
|
protected java.lang.String |
name
The name of this ServletManager. |
private static int |
NAME
|
(package private) long |
newSessionTimeout
The amount of time to wait before invalidating a new session that has never been "used" by the client. |
private static java.util.Random |
randomSource
|
private java.util.Hashtable |
servletContexts
The cache of loaded servlets |
protected java.util.Vector |
servletNames
The names of all the named servlet. |
private static int |
session_count
|
protected java.lang.String |
session_identifier
A (slightly more) unique session identifier derived from SESSION_IDENTIFIER_BASE and name . |
(package private) static java.lang.String |
SESSION_IDENTIFIER_BASE
The name of the session parameter. |
(package private) long |
sessionCheckFrequency
How frequently to check for the existence of timed-out sessions. |
protected java.util.Hashtable |
sessions
The sessions in this manager. |
(package private) long |
sessionTimeout
The amount of time to wait before invalidating an unused session. |
(package private) boolean |
sessionUseCookies
This flag determines how sessions are created. |
protected java.lang.String[] |
startups
The servlets to load on startup. |
protected java.lang.ThreadGroup |
tGroup
The ThreadGroup in which the servlets are run. |
static long |
ticDifference
|
private static int |
VALUE
|
Constructor Summary | |
(package private) |
JServServletManager(java.lang.String name,
java.lang.String confFile)
Creates a new servlet manager. |
Method Summary | |
void |
checkReload(JServSendError errorHandler)
Reinstantiate the classloader if necessary. |
JServSession |
createSession(javax.servlet.http.HttpServletResponse response)
Creates a new session. |
JServSession |
createSession(javax.servlet.http.HttpServletResponse response,
java.lang.String route)
Creates a new session. |
void |
destroyServlet(java.lang.String servletName)
Destroy one servlet or a set of SingleThreadModel servlets. |
void |
destroyServlets()
Destroy all the servlets and servlet contexts. |
java.lang.String |
encodeUrl(java.lang.String url,
java.lang.String id)
Encode a URL with a session identifier. |
java.lang.String |
getCookieSessionId(javax.servlet.http.Cookie[] cookies)
Get the session identifier set in cookies. |
private static java.lang.String |
getIdentifier()
|
private java.lang.String |
getIdentifier(java.lang.String jsIdent)
|
java.util.Enumeration |
getIds()
Returns an enumeration of all of the session IDs in this context. |
java.util.Enumeration |
getLoadedServlets()
Get an enumeration of all the servlets that have been loaded. |
java.lang.String |
getName()
Get the name of this ServletManager. |
java.util.Enumeration |
getServletNames()
Get all the name that are defined in this ServletManager |
javax.servlet.http.HttpSession |
getSession(java.lang.String sessionId)
Returns the session bound to the specified session ID. |
java.lang.String |
getUrlSessionId(java.lang.String queryStr)
Get the session identifier in a query string. |
void |
init(JServSendError errorHandler)
Load the configuration from the property file and load the startup servlets. |
protected JServContext |
load_init(java.lang.String name,
JServSendError se)
|
JServContext |
loadServlet(java.lang.String name,
JServSendError se)
Loads and initialize a servlet. |
private void |
loadStartupServlets(JServSendError se)
Loads and initialize all the startup servlets. |
void |
removeSession(JServSession s)
Remove a session from the context. |
(package private) void |
returnSTMS(java.lang.String servletname,
JServContext context)
Return a context into a set of SingleThredModel servlets. |
void |
run()
The housekeeping thread Checks for sessions that have not been used for a certain amount of time and invalidates them. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final int NAME
private static final int VALUE
static final java.lang.String SESSION_IDENTIFIER_BASE
long initTimeout
long destroyTimeout
long sessionTimeout
long newSessionTimeout
long sessionCheckFrequency
boolean checkFile
boolean checkClasses
protected java.io.File confFile
protected long lastInitialization
protected Configurations confs
protected java.util.Properties defaultArgs
protected AdaptiveClassLoader loader
private java.util.Hashtable servletContexts
protected java.lang.ThreadGroup tGroup
protected java.lang.String session_identifier
name
.protected java.lang.String name
protected java.lang.String[] startups
protected java.util.Vector servletNames
protected java.util.Hashtable sessions
boolean sessionUseCookies
private static int session_count
private static long lastTimeVal
private static java.util.Random randomSource
public static final long maxRandomLen
public static final long maxSessionLifespanTics
public static final long ticDifference
Constructor Detail |
JServServletManager(java.lang.String name, java.lang.String confFile)
name
- The name of this ServletManager.propFile
- The name of the property file to use.Method Detail |
public void init(JServSendError errorHandler)
JServSendError
- An object that can handle errors.public void checkReload(JServSendError errorHandler) throws java.lang.Exception
errorHandler
- The object that knows what to do with errors.public java.util.Enumeration getServletNames()
public java.util.Enumeration getLoadedServlets()
public JServContext loadServlet(java.lang.String name, JServSendError se) throws javax.servlet.ServletException
servletName
- The name of the servlet to load.errorHandler
- The error handler to call back if there is an error.protected JServContext load_init(java.lang.String name, JServSendError se) throws javax.servlet.ServletException
private void loadStartupServlets(JServSendError se)
se
- The sendError handler to call back in case of error.public java.lang.String getName()
void returnSTMS(java.lang.String servletname, JServContext context)
public void destroyServlet(java.lang.String servletName)
servletName
- the name of the servletpublic void destroyServlets()
public final java.lang.String getUrlSessionId(java.lang.String queryStr)
queryStr
- The query string that came in from the url.public final java.lang.String getCookieSessionId(javax.servlet.http.Cookie[] cookies)
cookies
- The cookies to search for a session identifier.public java.lang.String encodeUrl(java.lang.String url, java.lang.String id)
url
- The url to encode.id
- The session identifier to encode with the url.private static java.lang.String getIdentifier()
private java.lang.String getIdentifier(java.lang.String jsIdent)
public javax.servlet.http.HttpSession getSession(java.lang.String sessionId)
sessionID
- the ID of a particular session object.public java.util.Enumeration getIds()
public JServSession createSession(javax.servlet.http.HttpServletResponse response)
response
- The response used to send a cookie to the client.public JServSession createSession(javax.servlet.http.HttpServletResponse response, java.lang.String route)
response
- The response used to send a cookie to the client.route
- Label to append to the id sent from jserv client.public void removeSession(JServSession s)
s
- The session to remove from this context.public void run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |