cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/servlet CocoonServlet.java ParanoidCocoonServlet.java
Date Thu, 22 Feb 2001 14:48:46 GMT
bloritsch    01/02/22 06:48:45

  Modified:    src/org/apache/cocoon/servlet Tag: xml-cocoon2
                        CocoonServlet.java ParanoidCocoonServlet.java
  Log:
  Added patch from Robert Mercano regarding correctly initializing the ClassLoader.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.66  +9 -2      xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
  retrieving revision 1.1.4.65
  retrieving revision 1.1.4.66
  diff -u -r1.1.4.65 -r1.1.4.66
  --- CocoonServlet.java	2001/02/22 14:03:48	1.1.4.65
  +++ CocoonServlet.java	2001/02/22 14:48:44	1.1.4.66
  @@ -62,7 +62,7 @@
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.4.65 $ $Date: 2001/02/22 14:03:48 $
  + * @version CVS $Revision: 1.1.4.66 $ $Date: 2001/02/22 14:48:44 $
    */
   
   public class CocoonServlet extends HttpServlet {
  @@ -98,7 +98,7 @@
       throws ServletException {
   
           super.init(conf);
  -        ClassLoader classloader = this.getClass().getClassLoader();
  +        ClassLoader classloader = buildInitClassLoader();
           ServletContext context = conf.getServletContext();
   
           ClassUtils.setClassLoader(classloader);
  @@ -124,6 +124,13 @@
   
           this.createCocoon();
       }
  +
  +    /**
  +     * get the classloader to use for Cocoon instantiation
  +     */
  +     protected ClassLoader buildInitClassLoader() {
  +        return this.getClass().getClassLoader();
  +     }
   
       /**
        * This builds the important ClassPath used by this Servlet.  It
  
  
  
  1.1.2.5   +10 -4     xml-cocoon/src/org/apache/cocoon/servlet/Attic/ParanoidCocoonServlet.java
  
  Index: ParanoidCocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/ParanoidCocoonServlet.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- ParanoidCocoonServlet.java	2001/02/22 13:34:35	1.1.2.4
  +++ ParanoidCocoonServlet.java	2001/02/22 14:48:45	1.1.2.5
  @@ -32,11 +32,18 @@
    * of it.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/02/22 13:34:35 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/02/22 14:48:45 $
    */
   
   public class ParanoidCocoonServlet extends CocoonServlet {
   
  +     /**
  +      * get the classloader to use for Cocoon instantiation
  +      */
  +     protected ClassLoader buildInitClassLoader() {
  +         return new RepositoryClassLoader(new URL[] {}, this.getClass().getClassLoader());
  +     }
  +
       /**
        * This builds the important ClassPath used by this Servlet.  It
        * does so in a Servlet Engine neutral way.  It uses the
  @@ -55,7 +62,8 @@
        */
        protected String getClassPath(final ServletContext context)
        throws ServletException {
  -        RepositoryClassLoader classloader = new RepositoryClassLoader(new URL[] {}, (ClassLoader)
this.appContext.get(Constants.CONTEXT_CLASS_LOADER));
  +        RepositoryClassLoader classloader =
  +            (RepositoryClassLoader) this.appContext.get(Constants.CONTEXT_CLASS_LOADER);
           StringBuffer buildClassPath = new StringBuffer();
           String classDirPath = getInitParameter("class-dir");
           String libDirPath = getInitParameter("lib-dir");
  @@ -96,8 +104,6 @@
                   }
               }
           }
  -
  -        this.appContext.put(Constants.CONTEXT_CLASS_LOADER, classloader);
   
           buildClassPath.append(File.pathSeparatorChar)
                         .append(System.getProperty("java.class.path"));
  
  
  

Mime
View raw message