|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--org.apache.cocoon.servlet.CocoonServlet
This is the entry point for Cocoon execution as an HTTP Servlet.
Field Summary | |
protected boolean |
allowReload
Allow reloading of cocoon by specifying the cocoon-reload parameter with a request |
protected org.apache.avalon.framework.context.DefaultContext |
appContext
|
protected java.lang.ClassLoader |
classLoader
The classloader that will be set as the context classloader if init-classloader is true |
protected Cocoon |
cocoon
The Cocoon instance |
protected long |
creationTime
The time the cocoon instance was created |
protected java.lang.Exception |
exception
|
protected java.lang.String |
forceLoadParameter
|
protected java.lang.String |
forceSystemProperty
|
protected boolean |
hiddenShowTime
|
protected boolean |
initClassLoader
|
protected org.apache.log.Logger |
log
|
protected org.apache.avalon.excalibur.logger.LogKitManager |
logKitManager
|
protected static java.lang.String |
PROCESSED_BY
|
protected RequestFactory |
requestFactory
The requestFactory to use for incoming HTTP requests. |
protected javax.servlet.ServletContext |
servletContext
|
protected java.lang.String |
servletContextPath
This is the path to the servlet context (or the result of calling getRealPath('/') on the ServletContext. |
protected java.net.URL |
servletContextURL
This is the url to the servlet context directory |
protected boolean |
showTime
Allow adding processing time to the response |
Constructor Summary | |
CocoonServlet()
|
Method Summary | |
protected void |
addClassLoaderDirectory(java.lang.String dir)
Adds a directory to the classloader. |
protected void |
addClassLoaderURL(java.net.URL URL)
Adds an URL to the classloader. |
void |
destroy()
Dispose Cocoon when servlet is destroyed |
protected java.lang.String |
getClassPath()
This builds the important ClassPath used by this Servlet. |
protected Environment |
getEnvironment(java.lang.String uri,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Create the environment for the request |
protected java.lang.String |
getExtraClassPath()
Retreives the "extra-classpath" attribute, that needs to be added to the class path. |
void |
init(javax.servlet.ServletConfig conf)
Initialize this CocoonServlet instance. |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Process the specified HttpServletRequest producing output
on the specified HttpServletResponse . |
protected void |
updateEnvironment()
Method to update the environment before Cocoon instances are created. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String PROCESSED_BY
protected org.apache.log.Logger log
protected org.apache.avalon.excalibur.logger.LogKitManager logKitManager
protected long creationTime
protected Cocoon cocoon
Cocoon
instanceprotected java.lang.Exception exception
protected org.apache.avalon.framework.context.DefaultContext appContext
protected boolean allowReload
protected boolean showTime
protected boolean hiddenShowTime
protected javax.servlet.ServletContext servletContext
protected java.lang.ClassLoader classLoader
protected boolean initClassLoader
protected java.lang.String forceLoadParameter
protected java.lang.String forceSystemProperty
protected java.lang.String servletContextPath
protected java.net.URL servletContextURL
protected RequestFactory requestFactory
Constructor Detail |
public CocoonServlet()
Method Detail |
public void init(javax.servlet.ServletConfig conf) throws javax.servlet.ServletException
CocoonServlet
instance. You will
notice that I have broken the init into sub methods to make it
easier to maintain (BL). The context is passed to a couple of
the subroutines. This is also because it is better to explicitly
pass variables than implicitely. It is both more maintainable,
and more elegant.init
in class javax.servlet.GenericServlet
conf
- The ServletConfig object from the servlet engine.javax.servlet.ServletException
- public void destroy()
destroy
in class javax.servlet.GenericServlet
protected void addClassLoaderURL(java.net.URL URL)
ParanoidCocoonServlet
.protected void addClassLoaderDirectory(java.lang.String dir)
ParanoidCocoonServlet
.protected java.lang.String getClassPath() throws javax.servlet.ServletException
ServletContext
's getRealPath
method
to get the Servlet 2.2 identified classes and lib directories.
It iterates in alphabetical order through every file in the
lib directory and adds it to the classpath.
Also, we add the files to the ClassLoader for the Cocoon system.
In order to protect ourselves from skitzofrantic classloaders,
we need to work with a known one.
We need to get this to work properly when Cocoon is in a war.javax.servlet.ServletException
- protected java.lang.String getExtraClassPath() throws javax.servlet.ServletException
javax.servlet.ServletException
- public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
HttpServletRequest
producing output
on the specified HttpServletResponse
.service
in class javax.servlet.http.HttpServlet
protected Environment getEnvironment(java.lang.String uri, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.lang.Exception
protected void updateEnvironment() throws javax.servlet.ServletException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |