|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.cocoon.servlet.ParanoidCocoonServlet
public class ParanoidCocoonServlet
This servlet builds a classloading sandbox and runs another servlet inside that sandbox. The purpose is to shield the libraries and classes shipped with the web application from any other classes with the same name that may exist in the system, such as Xerces and Xalan versions included in JDK 1.4.
This servlet propagates all initialisation parameters to the sandboxed
servlet, and accepts the parameters servlet-class
and
paranoid-classpath
.
servlet-class
defines the sandboxed servlet class, the
default is CocoonServlet
paranoid-classpath
expects the name of a text file that
can contain lines begining with
class-dir: (directory containing classes),
lib-dir: (directory containing JAR or ZIP libraries) and #
(for comments).
All other lines are considered as URLs.
It is also possible to use a the pseudo protocol prefixcontext:/ which
is resolved to the basedir of the servlet context.
Field Summary | |
---|---|
protected ClassLoader |
classloader
|
protected static String |
CONTEXT_PREFIX
|
static String |
DEFAULT_SERVLET_CLASS
The name of the actual servlet class. |
protected static String |
FILE_PREFIX
|
protected Servlet |
servlet
|
Constructor Summary | |
---|---|
ParanoidCocoonServlet()
|
Method Summary | |
---|---|
protected ClassLoader |
createClassLoader(String className,
URL[] classPath)
|
void |
destroy()
Destroy the actual servlet |
protected ClassLoader |
getClassLoader(File contextDir)
Deprecated. |
protected ClassLoader |
getClassLoader(String externalClasspath,
File contextDir)
Deprecated. |
protected URL[] |
getClassPath(File contextDir)
|
protected URL[] |
getClassPath(String externalClasspath,
File contextDir)
|
protected File |
getContextDir()
Get the web application context directory. |
void |
init(ServletConfig config)
|
protected void |
initServlet()
Initialize the wrapped servlet. |
void |
service(ServletRequest request,
ServletResponse response)
Service the request by delegating the call to the real servlet |
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 |
---|
public static final String DEFAULT_SERVLET_CLASS
protected static final String CONTEXT_PREFIX
protected static final String FILE_PREFIX
protected Servlet servlet
protected ClassLoader classloader
Constructor Detail |
---|
public ParanoidCocoonServlet()
Method Detail |
---|
public void init(ServletConfig config) throws ServletException
init
in interface Servlet
init
in class GenericServlet
ServletException
protected void initServlet() throws ServletException
BootstrapServlet
change the ServletConfig
given to the servlet.
ServletException
protected File getContextDir() throws ServletException
ServletException
protected URL[] getClassPath(File contextDir) throws ServletException
ServletException
protected URL[] getClassPath(String externalClasspath, File contextDir) throws ServletException
ServletException
protected ClassLoader createClassLoader(String className, URL[] classPath) throws ServletException
ServletException
protected ClassLoader getClassLoader(File contextDir) throws ServletException
ServletException
protected ClassLoader getClassLoader(String externalClasspath, File contextDir) throws ServletException
ServletException
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
service
in interface Servlet
service
in class HttpServlet
ServletException
IOException
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |