cziegeler    2003/07/02 11:33:38

  Modified:    src/java/org/apache/cocoon/servlet
                        ParanoidCocoonServlet.java BootstrapServlet.java
  Log:
  Make classes more "open" for changes
  
  Revision  Changes    Path
  1.4       +7 -8      
cocoon-2.1/src/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java
  
  Index: ParanoidCocoonServlet.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/servlet/ParanoidCocoonServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParanoidCocoonServlet.java        5 Jun 2003 16:33:59 -0000       1.3
  +++ ParanoidCocoonServlet.java        2 Jul 2003 18:33:38 -0000       1.4
  @@ -87,9 +87,9 @@
         */
        public static final String DEFAULT_SERVLET_CLASS = 
"org.apache.cocoon.servlet.CocoonServlet";
       
  -     private Servlet servlet;
  +     protected Servlet servlet;
       
  -     private ClassLoader classloader;
  +    protected ClassLoader classloader;
       
        public void init(ServletConfig config) throws ServletException {
                
  @@ -118,7 +118,7 @@
                Thread.currentThread().setContextClassLoader(this.classloader);
           
                // Inlitialize the actual servlet
  -             initServlet(servlet);
  +             this.initServlet();
           
        }
        
  @@ -126,11 +126,10 @@
         * Initialize the wrapped servlet. Subclasses (see [EMAIL PROTECTED] 
BootstrapServlet} change the
         * <code>ServletConfig</code> given to the servlet.
         * 
  -      * @param servlet the servlet to initialize
         * @throws ServletException
         */
  -     protected void initServlet(Servlet servlet) throws ServletException {
  -             this.servlet.init(getServletConfig());
  +     protected void initServlet() throws ServletException {
  +             this.servlet.init(this.getServletConfig());
        }
        
        /**
  @@ -151,7 +150,7 @@
         * 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.
         */
  -     private ClassLoader getClassLoader(File contextDir) throws ServletException {
  +     protected ClassLoader getClassLoader(File contextDir) throws ServletException {
                List urlList = new ArrayList();
           
                try {
  
  
  
  1.3       +4 -4      
cocoon-2.1/src/java/org/apache/cocoon/servlet/BootstrapServlet.java
  
  Index: BootstrapServlet.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/servlet/BootstrapServlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BootstrapServlet.java     3 Jun 2003 13:25:42 -0000       1.2
  +++ BootstrapServlet.java     2 Jul 2003 18:33:38 -0000       1.3
  @@ -83,7 +83,7 @@
   
   public class BootstrapServlet extends ParanoidCocoonServlet {
       
  -    private File contextDir;
  +    protected File contextDir;
       
        protected File getContextDir() throws ServletException {
                
  @@ -124,12 +124,12 @@
        }
   
   
  -    protected void initServlet(Servlet servlet) throws ServletException {
  +    protected void initServlet() throws ServletException {
           
           ServletContext newContext = new ContextWrapper(getServletContext(), 
this.contextDir);
           ServletConfig newConfig = new ConfigWrapper(getServletConfig(), newContext);
           
  -        servlet.init(newConfig);        
  +        this.servlet.init(newConfig);        
       }
   
       //-------------------------------------------------------------------------
  
  
  

Reply via email to