tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java
Date Mon, 16 Jul 2001 17:53:53 GMT
costin      01/07/16 10:53:53

  Modified:    src/share/org/apache/tomcat/modules/config
                        LoaderInterceptor11.java
  Log:
  Fix the fix - loader must be reset in init since modules could change the
  classpath during addContext.
  
  Revision  Changes    Path
  1.15      +20 -5     jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LoaderInterceptor11.java
  
  Index: LoaderInterceptor11.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LoaderInterceptor11.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- LoaderInterceptor11.java	2001/07/16 00:02:32	1.14
  +++ LoaderInterceptor11.java	2001/07/16 17:53:53	1.15
  @@ -146,13 +146,17 @@
   	    }
   	}
   
  -	ClassLoader loader=constructLoader( context );
  -	context.setClassLoader( loader );
  -
  -	// support for jasper and other applications
  -	context.setAttribute( "org.apache.tomcat.classloader",loader);
  +	// needed for modules using classes from the context
  +	prepareClassLoader(context);
       }
   
  +    public void contextInit( Context ctx )
  +	throws TomcatException
  +    {
  +	// jsp will add it's own stuff
  +	prepareClassLoader( ctx );
  +    }
  +    
       /** Construct another class loader, when the context is reloaded.
        */
       public void reload( Request req, Context context) throws TomcatException {
  @@ -171,6 +175,17 @@
   	context.setAttribute( "org.apache.tomcat.classloader", loader);
       }
   
  +    /** Initialize the class loader.
  +     *  
  +     */
  +    public void prepareClassLoader(Context context) throws TomcatException {
  +	ClassLoader loader=constructLoader( context );
  +	context.setClassLoader( loader );
  +
  +	// support for jasper and other applications
  +	context.setAttribute( "org.apache.tomcat.classloader",loader);
  +    }
  +    
       /** Override this method to provide an alternate loader
        *  (or create a new interceptor )
        */
  
  
  

Mime
View raw message