cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r407329 - in /cocoon/trunk: blocks/cocoon-paranoid/cocoon-paranoid-impl/ blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ core/cocoon-webapp/ core/cocoon-webapp/src/main/webapp/WEB-INF/
Date Wed, 17 May 2006 17:17:20 GMT
Author: cziegeler
Date: Wed May 17 10:17:19 2006
New Revision: 407329

URL: http://svn.apache.org/viewvc?rev=407329&view=rev
Log:
Cleanup paranoid block and use paranoid servlet as default

Modified:
    cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/pom.xml
    cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/BootstrapServlet.java
    cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidClassLoader.java
    cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
    cocoon/trunk/core/cocoon-webapp/pom.xml
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml

Modified: cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/pom.xml?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/pom.xml Wed May 17 10:17:19 2006
@@ -33,14 +33,10 @@
   <description/>
   <dependencies>
     <dependency>
-      <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-core</artifactId>
-      <version>2.2.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>servletapi</groupId>
-      <artifactId>servletapi</artifactId>
-      <version>2.3</version>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.3</version>
+      <scope>provided</scope>
     </dependency>
   </dependencies>
 </project>

Modified: cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/BootstrapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/BootstrapServlet.java?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/BootstrapServlet.java
(original)
+++ cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/BootstrapServlet.java
Wed May 17 10:17:19 2006
@@ -42,10 +42,8 @@
  * <li>resolve paths for context resources.
  * </ul>
  *
- * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  * @version $Id$
  */
-
 public class BootstrapServlet extends ParanoidCocoonServlet {
     
     protected File contextDir;

Modified: cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidClassLoader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidClassLoader.java?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidClassLoader.java
(original)
+++ cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidClassLoader.java
Wed May 17 10:17:19 2006
@@ -21,15 +21,12 @@
 import java.net.URLClassLoader;
 import java.net.URLStreamHandlerFactory;
 
-/*
+/**
  * The <code>ParanoidClassLoader</code> reverses the search order for
  * classes.  It checks this classloader before it checks its parent.
  *
- * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
- * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version $Id$
  */
-
 public class ParanoidClassLoader extends URLClassLoader {
 
     /**
@@ -67,22 +64,6 @@
      */
     public ParanoidClassLoader(final URL[] urls, final ClassLoader parent, final URLStreamHandlerFactory
factory) {
         super(urls, parent, factory);
-    }
-
-    /**
-     * Extends <code>URLClassLoader</code>'s initialization methods so we
-     * return a <code>ParanoidClassLoad</code> instead.
-     */
-    public static final URLClassLoader newInstance(final URL[] urls) {
-        return new ParanoidClassLoader(urls);
-    }
-
-    /**
-     * Extends <code>URLClassLoader</code>'s initialization methods so we
-     * return a <code>ParanoidClassLoad</code> instead.
-     */
-    public static final URLClassLoader newInstance(final URL[] urls, final ClassLoader parent)
{
-        return new ParanoidClassLoader(urls, parent);
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
(original)
+++ cocoon/trunk/blocks/cocoon-paranoid/cocoon-paranoid-impl/src/main/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
Wed May 17 10:17:19 2006
@@ -57,12 +57,8 @@
  *      is resolved to the basedir of the servlet context.
  * </ul>
  *
- * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
- * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @author <a href="mailto:tcurdt@apache.org">Torsten Curdt</a>
  * @version $Id$
  */
-
 public class ParanoidCocoonServlet extends HttpServlet {
 
     /**
@@ -78,10 +74,11 @@
 
     protected ClassLoader classloader;
 
+    /**
+     * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
+     */
     public void init(ServletConfig config) throws ServletException {
-
         super.init(config);
-
         // Create the classloader in which we will load the servlet
         // this can either be specified by an external file configured
         // as a parameter in web.xml or (the default) all jars and
@@ -98,7 +95,6 @@
         }
         this.classloader = createClassLoader(classLoaderName, getContextDir(), classPath);
 
-        
         String servletName = config.getInitParameter("servlet-class");
         if (servletName == null) {
             servletName = DEFAULT_SERVLET_CLASS;
@@ -188,7 +184,7 @@
 
         return urls;
     }
-    
+
     protected URL[] getClassPath(final String externalClasspath, final File contextDir) throws
ServletException {
         final List urlList = new ArrayList();
 
@@ -250,14 +246,16 @@
         } catch (IOException io) {
             throw new ServletException(io);
         }
-
         URL[] urls = (URL[]) urlList.toArray(new URL[urlList.size()]);
 
         return urls;
     }
 
-    protected ClassLoader createClassLoader(final String className, final File contextDir,
final URL[] classPath) throws ServletException {
-        if (className != null) {
+    protected ClassLoader createClassLoader(final String className,
+                                            final File contextDir,
+                                            final URL[] classPath)
+    throws ServletException {
+        if (className != null && !className.equals(ParanoidClassLoader.class.getName()))
{
             try {
                 final Class classLoaderClass = Class.forName(className);
                 final Class[] parameterClasses = new Class[] { ClassLoader.class, File.class
};
@@ -283,35 +281,14 @@
                 throw new ServletException("", e);
             }
         } else {
-            return ParanoidClassLoader.newInstance(classPath, this.getClass().getClassLoader());
+            return new ParanoidClassLoader(classPath, this.getClass().getClassLoader());
         }
     }
 
-    
-    /**
-     * Get the classloader that will be used to create the actual servlet. Its
-     * classpath is defined by the WEB-INF/classes and WEB-INF/lib directories
-     * in the context dir.
-     * @deprecated
-     */
-    protected ClassLoader getClassLoader(File contextDir) throws ServletException {
-        return createClassLoader(null, contextDir, getClassPath(contextDir));
-    }
-
-    /**
-     * Get the classloader that will be used to create the actual servlet. Its
-     * classpath is defined by an external file.
-     * @deprecated
-     */
-    protected ClassLoader getClassLoader(final String externalClasspath, final File contextDir)
throws ServletException {
-        return createClassLoader(null, contextDir, getClassPath(externalClasspath, contextDir));
-    }
-
     /**
      * Service the request by delegating the call to the real servlet
      */
     public void service(ServletRequest request, ServletResponse response) throws ServletException,
IOException {
-
         final ClassLoader old = Thread.currentThread().getContextClassLoader();
         try {
             Thread.currentThread().setContextClassLoader(this.classloader);
@@ -325,7 +302,6 @@
      * Destroy the actual servlet
      */
     public void destroy() {
-
         if (this.servlet != null) {
             final ClassLoader old = Thread.currentThread().getContextClassLoader();
             try {
@@ -335,7 +311,6 @@
                 Thread.currentThread().setContextClassLoader(old);
             }
         }
-
         super.destroy();
     }
 
@@ -344,6 +319,4 @@
             return name.endsWith(".zip") || name.endsWith(".jar");
         }
     }
-
-}
-
+}
\ No newline at end of file

Modified: cocoon/trunk/core/cocoon-webapp/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/pom.xml?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/pom.xml (original)
+++ cocoon/trunk/core/cocoon-webapp/pom.xml Wed May 17 10:17:19 2006
@@ -82,6 +82,11 @@
       <artifactId>cocoon-core</artifactId>
       <version>2.2.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-paranoid-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>    
     <!--dependency> cocoon-session-fw-sample doesn't work because of old-style xconf/roles-files
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-session-fw-sample</artifactId>

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml?rev=407329&r1=407328&r2=407329&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/web.xml Wed May 17 10:17:19 2006
@@ -47,19 +47,19 @@
     <description>Cocoon</description>
 
     <!--
-      The regular servlet class (trusts the servlet container classloader)
-      -->
-    <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
-    <!--
       The paranoid servlet class, to be used instead of regular one when
       having conflicts between libraries used by Cocoon and the servlet
       container.
+    -->
     <servlet-class>org.apache.cocoon.servlet.ParanoidCocoonServlet</servlet-class>
     <init-param>
       <param-name>classloader-class</param-name>
-      <param-value>org.apache.commons.javaflow.ContinuationCompilingClassLoader</param-value>
+      <param-value>org.apache.cocoon.servlet.ParanoidClassLoader</param-value>
     </init-param>
-    -->
+    <!--
+      The regular servlet class (trusts the servlet container classloader)
+    <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
+      -->
 
     <!--
       Set encoding used by the container. If not set the ISO-8859-1 encoding



Mime
View raw message