|
|||||||||
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.
Field Summary | |
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. |
protected long |
lastInitialization
The time of the last initialization. |
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. |
protected java.util.Vector |
servletNames
The names of all the named servlet. |
protected java.lang.String |
session_identifier
A (slightly more) unique session identifier derived from SESSION_IDENTIFIER_BASE and name . |
protected java.util.Hashtable |
sessions
The sessions in this manager. |
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
|
Fields inherited from interface org.apache.jserv.JServLogChannels |
CH_CONTAINER_EXCEPTION,
CH_CRITICAL,
CH_DEBUG,
CH_INFO,
CH_SERVLET_EXCEPTION,
CH_SERVLET_LOG,
CH_WARNING |
Method Summary | |
void |
checkReload(org.apache.jserv.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. |
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(org.apache.jserv.JServSendError errorHandler)
Load the configuration from the property file and load the startup servlets. |
protected org.apache.jserv.JServContext |
load_init(java.lang.String name,
org.apache.jserv.JServSendError se)
|
org.apache.jserv.JServContext |
loadServlet(java.lang.String name,
org.apache.jserv.JServSendError se)
Loads and initialize a servlet. |
void |
removeSession(JServSession s)
Remove a session from the context. |
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 |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.io.File confFile
protected long lastInitialization
protected Configurations confs
protected java.util.Properties defaultArgs
protected AdaptiveClassLoader loader
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
public static final long maxRandomLen
public static final long maxSessionLifespanTics
public static final long ticDifference
Method Detail |
public void init(org.apache.jserv.JServSendError errorHandler)
JServSendError
- An object that can handle errors.public void checkReload(org.apache.jserv.JServSendError errorHandler)
errorHandler
- The object that knows what to do with errors.public java.util.Enumeration getServletNames()
public java.util.Enumeration getLoadedServlets()
public org.apache.jserv.JServContext loadServlet(java.lang.String name, org.apache.jserv.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 org.apache.jserv.JServContext load_init(java.lang.String name, org.apache.jserv.JServSendError se) throws javax.servlet.ServletException
public java.lang.String getName()
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.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 |