cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2002-08-20 Thread billbarker

billbarker2002/08/20 21:08:43

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Session reloading support on Context reload.
  
  Revision  ChangesPath
  1.25  +23 -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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- LoaderInterceptor11.java  11 Jan 2002 07:01:24 -  1.24
  +++ LoaderInterceptor11.java  21 Aug 2002 04:08:43 -  1.25
  @@ -96,6 +96,7 @@
   Vector additionalJars=new Vector();
   String additionalJarsS=null;
   String jarSeparator=":";
  +static final String clAttribute = "org.apache.tomcat.classloader";
   
   public LoaderInterceptor11() {
   }
  @@ -230,13 +231,30 @@
   
   }
   
  +/** setup the ClassLoader for this context.
  + *  If this is a re-loaded context, do nothing.
  + */
   public void contextInit( Context ctx )
throws TomcatException
   {
// jsp will add it's own stuff
  - prepareClassLoader( ctx );
  + if(ctx.getAttribute(clAttribute) == null) {
  + prepareClassLoader( ctx );
  + }
   }
  -
  +
  +public void copyContext(Request req, Context oldC, Context newC)
  + throws TomcatException {
  + if(debug > 0)
  + log( "Reload event " + newC.getPath() );
  + // construct a new loader
  + ClassLoader oldLoader=oldC.getClassLoader();
  +
  + // will be used by reloader or other modules to try to
  + // migrate the data. 
  + newC.getContainer().setNote( "oldLoader", oldLoader);
  +}
  +
   /** Construct another class loader, when the context is reloaded.
*/
   public void reload( Request req, Context context) throws TomcatException {
  @@ -259,7 +277,7 @@
   }
   
context.setClassLoader( loader );
  - context.setAttribute( "org.apache.tomcat.classloader", loader);
  + context.setAttribute( clAttribute, loader);
   }
   
   /** Initialize the class loader.
  @@ -309,7 +327,7 @@
context.setClassLoader( loader );
   
// support for jasper and other applications
  - context.setAttribute( "org.apache.tomcat.classloader",loader);
  + context.setAttribute(clAttribute, loader);
   }
   
   /** Override this method to provide an alternate loader
  @@ -405,7 +423,7 @@
if (k.equals("org.apache.tomcat.jsp_classpath")) {
return getClassPath(ctx);
}
  - if(k.equals("org.apache.tomcat.classloader")) {
  + if(k.equals(clAttribute)) {
return ctx.getClassLoader();
}
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2002-01-10 Thread billbarker

billbarker02/01/10 23:01:24

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Allow the user to optionally configure to use the 1.1 loader even under Java2.
  
  SimpleClassLoader should handle replaced jar files better than URLClassLoader.  This 
makes this an option for people that want jar reloading, and can live without 
enforcement of Java2 Manifest options.  Hopefully this gives the best of 3.2 and 3.3 
for these people.
  
  Revision  ChangesPath
  1.24  +14 -1 
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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- LoaderInterceptor11.java  5 Dec 2001 11:26:57 -   1.23
  +++ LoaderInterceptor11.java  11 Jan 2002 07:01:24 -  1.24
  @@ -83,6 +83,7 @@
   boolean useCommonL=false;
   boolean useContainerL=false;
   boolean useNoParent=false;
  +boolean use11Loader=false;
   
   boolean addJaxp=true;
   
  @@ -112,6 +113,13 @@
useNoParent=b;
   }
   
  +/** Use the 1.1 loader even if running under Java2.
  + *  This allows for a work-around to the currently broken URLClassLoader
  + *  which can't reload classes from changed jar files.
  + */
  +public void setUse11Loader( boolean b ) {
  + use11Loader = b;
  +}
   
   /** Directory where jaxp jars are installed. Defaults to
tomcat_install/lib/container, where the parser used by
  @@ -324,7 +332,12 @@
parent=this.getClass().getClassLoader();
}

  - ClassLoader loader=jdk11Compat.newClassLoaderInstance( classP, parent);
  + ClassLoader loader=null;
  + if( use11Loader ) {
  + loader = new SimpleClassLoader(classP, parent);
  + } else {
  + loader=jdk11Compat.newClassLoaderInstance( classP, parent);
  + }
if( debug > 0 )
log("Loader " + loader.getClass().getName() + " " + parent);
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-12-05 Thread larryi

larryi  01/12/05 03:26:57

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Updates so jaxpJars can include absolute paths.
  
  Added a "jarSeparator" attribute to allow changing the separator from
  the default ':' so Windows absolute paths can be used.
  
  Implemented "additionalJars" attribute and support for an additionalJars
  context property to add a list of jars to the web application classloader.
  This avoids trying to use jaxpJars to perform this feature..
  
  Revision  ChangesPath
  1.23  +75 -10
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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- LoaderInterceptor11.java  2001/10/09 17:42:27 1.22
  +++ LoaderInterceptor11.java  2001/12/05 11:26:57 1.23
  @@ -89,8 +89,12 @@
   private int attributeInfo;
   String loader=null;
   Vector jaxpJars=new Vector();
  -String jaxpJarsS="jaxp.jar:crimson.jar:xalan.jar:xerces.jar";
  +String jaxpJarsSDefault="jaxp.jar:crimson.jar:xalan.jar:xerces.jar";
  +String jaxpJarsS=null;
   String jaxpDir=null;
  +Vector additionalJars=new Vector();
  +String additionalJarsS=null;
  +String jarSeparator=":";
   
   public LoaderInterceptor11() {
   }
  @@ -125,6 +129,31 @@
jaxpJarsS=jars;
   }
   
  +/** List of additional jars to add to each web application.
  + */
  +public void setAdditionalJars(String jars ) {
  + additionalJarsS=jars;
  +}
  +
  +/** Character to use to separate jars in the jaxpJars list.
  +It also applies to the additionalJars context property
  +list.
  + */
  +public void setJarSeparator(String sep) {
  +if( sep != null && sep.length() > 0 ) {
  +if( sep.length() > 1 )
  +sep = sep.substring(0,1);
  +
  +char oldSep[]=new char[1];
  +char newSep[]=new char[1];
  +jarSeparator.getChars(0,1,oldSep,0 );
  +sep.getChars(0,1,newSep,0);
  +jaxpJarsSDefault=jaxpJarsSDefault.replace(oldSep[0],newSep[0]);
  +
  +jarSeparator=sep;
  +}
  +}
  +
   /** Check if the webapp contains jaxp , and add one if not.
This allow apps to include their own parser if they want,
while using the normal delegation model.
  @@ -146,6 +175,7 @@
attributeInfo=cm.getNoteId(ContextManager.REQUEST_NOTE,
   "req.attribute");
initJaxpJars();
  +initAdditionalJars();
   }
   
   
  @@ -228,11 +258,30 @@
*  
*/
   public void prepareClassLoader(Context context) throws TomcatException {
  +String list = context.getProperty("additionalJars");
  +if( list != null ) {
  +Vector urls=new Vector();
  +getUrls( null, list, urls );
  +Enumeration en=urls.elements();
  +while( en.hasMoreElements() ) {
  +URL url=(URL)en.nextElement();
  +if( debug > 0 ) log(context + " adding: " + url);
  +context.addClassPath( url );
  +}
  +}
  +
  +Enumeration en=additionalJars.elements();
  +while( en.hasMoreElements() ) {
  +URL url=(URL)en.nextElement();
  +if( debug > 0 ) log(context + " adding: " + url);
  +context.addClassPath( url );
  +}
  +
ClassLoader loader=constructLoader( context );
if( addJaxp ) {
boolean hasJaxp=checkJaxp( loader, context );
if( ! hasJaxp ) {
  - Enumeration en=jaxpJars.elements();
  + en=jaxpJars.elements();
while( en.hasMoreElements() ) {
URL url=(URL)en.nextElement();
if( debug > 0 ) log(context + " adding jaxp: " + url);
  @@ -241,6 +290,7 @@
loader=constructLoader( context );
}
}
  +
if( debug>5 ) {
URL classP[]=context.getClassPath();
log("  Context classpath URLs:");
  @@ -267,7 +317,7 @@
if( debug > 0 ) log( "Using no parent loader ");
parent=null;
} else if( useAppsL && !context.isTrusted() ) {
  - if( debug > 0 ) log( "Using webapp loader " + context.isTrusted());
  + if( debug > 0 ) log( "Using webapp loader ");
parent=cm.getAppsLoader();
} else {
if( debug > 0 ) log( "Using container loader ");
  @@ -284,22 +334,37 @@
   }
   
   private void initJaxpJars() {
  - if( jaxpDir==null ) jaxpDir=cm.getInstallDir() + "/lib/container";
  - File 

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-09-08 Thread larryi

larryi  01/09/08 13:11:00

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Make useNoParent take priority over useAppsL.  This shouldn't hurt
  usability and is more straightforward to document.
  
  Revision  ChangesPath
  1.18  +4 -4  
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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- LoaderInterceptor11.java  2001/08/21 04:58:22 1.17
  +++ LoaderInterceptor11.java  2001/09/08 20:11:00 1.18
  @@ -207,12 +207,12 @@
   }
   
ClassLoader parent=null;
  - if( useAppsL && !context.isTrusted() ) {
  - if( debug > 0 ) log( "Using webapp loader " + context.isTrusted());
  - parent=cm.getAppsLoader();
  - } else if( useNoParent ) {
  + if( useNoParent ) {
if( debug > 0 ) log( "Using no parent loader ");
parent=null;
  + } else if( useAppsL && !context.isTrusted() ) {
  + if( debug > 0 ) log( "Using webapp loader " + context.isTrusted());
  + parent=cm.getAppsLoader();
} else {
if( debug > 0 ) log( "Using container loader ");
parent=this.getClass().getClassLoader();
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-08-20 Thread costin

costin  01/08/20 21:58:22

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Use _application_ loader, not parent loader. It worked because of a double bug,
  but fixing the first bug revealed this one.
  
  Revision  ChangesPath
  1.17  +13 -4 
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- LoaderInterceptor11.java  2001/07/19 05:56:00 1.16
  +++ LoaderInterceptor11.java  2001/08/21 04:58:22 1.17
  @@ -78,9 +78,14 @@
* @author [EMAIL PROTECTED]
*/
   public class LoaderInterceptor11 extends BaseInterceptor {
  -boolean useAL=true;
  +boolean useAppsL=true;
  +boolean useParentL=false;
  +boolean useCommonL=false;
  +boolean useContainerL=false;
   boolean useNoParent=false;
  +
   private int attributeInfo;
  +String loader=null;
   
   public LoaderInterceptor11() {
   }
  @@ -89,7 +94,7 @@
*  that is set by the application embedding tomcat.
*/
   public void setUseApplicationLoader( boolean b ) {
  - useAL=b;
  + useAppsL=b;
   }
   
   /** Use no parent loader. The contexts will be completely isolated.
  @@ -98,6 +103,10 @@
useNoParent=b;
   }
   
  +public void setLoader( String name ) {
  + loader=name;
  +}
  +
   public void engineInit( ContextManager cm )
throws TomcatException
   {
  @@ -198,9 +207,9 @@
   }
   
ClassLoader parent=null;
  - if( useAL && !context.isTrusted() ) {
  + if( useAppsL && !context.isTrusted() ) {
if( debug > 0 ) log( "Using webapp loader " + context.isTrusted());
  - parent=cm.getParentLoader();
  + parent=cm.getAppsLoader();
} else if( useNoParent ) {
if( debug > 0 ) log( "Using no parent loader ");
parent=null;
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-07-18 Thread costin

costin  01/07/18 22:56:00

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  The loader is created only on init, when all classpath components have been
  added.
  
  Revision  ChangesPath
  1.16  +0 -2  
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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LoaderInterceptor11.java  2001/07/16 17:53:53 1.15
  +++ LoaderInterceptor11.java  2001/07/19 05:56:00 1.16
  @@ -146,8 +146,6 @@
}
}
   
  - // needed for modules using classes from the context
  - prepareClassLoader(context);
   }
   
   public void contextInit( Context ctx )
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-07-16 Thread costin

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  ChangesPath
  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 )
*/
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-07-15 Thread costin

costin  01/07/15 17:02:32

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Set the class loader in addContext, there's no need to wait until
  contextInit.
  
  Revision  ChangesPath
  1.14  +0 -9  
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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- LoaderInterceptor11.java  2001/06/28 07:28:51 1.13
  +++ LoaderInterceptor11.java  2001/07/16 00:02:32 1.14
  @@ -145,15 +145,6 @@
} catch( MalformedURLException ex ) {
}
}
  -}
  -
  -/** Construct a class loader to be used with the context
  - */
  -public void contextInit( Context context)
  - throws TomcatException
  -{
  - if( debug>0 ) log( "Init context " + context.getPath());
  -ContextManager cm = context.getContextManager();
   
ClassLoader loader=constructLoader( context );
context.setClassLoader( loader );
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-06-16 Thread costin

costin  01/06/16 13:18:49

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Return the real classpath, including common and parent.
  
  Revision  ChangesPath
  1.11  +59 -1 
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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LoaderInterceptor11.java  2001/03/10 07:22:20 1.10
  +++ LoaderInterceptor11.java  2001/06/16 20:18:49 1.11
  @@ -80,6 +80,7 @@
   public class LoaderInterceptor11 extends BaseInterceptor {
   boolean useAL=false;
   boolean useNoParent=false;
  +private int attributeInfo;
   
   public LoaderInterceptor11() {
   }
  @@ -97,6 +98,13 @@
useNoParent=b;
   }
   
  +public void engineInit( ContextManager cm )
  + throws TomcatException
  +{
  + attributeInfo=cm.getNoteId(ContextManager.REQUEST_NOTE,
  +"req.attribute");
  +}
  +
   /** Add all WEB-INF/classes and WEB-INF/lib to the context
*  path
*/
  @@ -157,7 +165,8 @@
   /** Construct another class loader, when the context is reloaded.
*/
   public void reload( Request req, Context context) throws TomcatException {
  - log( "Reload event " + context.getPath() );
  + if( debug > 0 )
  + log( "Reload event " + context.getPath() );
   
// construct a new loader
ClassLoader oldLoader=context.getClassLoader();
  @@ -206,7 +215,56 @@
   }
   
   // 
  +private static final String separator =
  + System.getProperty("path.separator", ":");
  +
  +public final Object getInfo( Context ctx, Request req,
  +  int info, String k )
  +{
  + if( req!=null )
  + return null;
  + if( info== attributeInfo ) {
  + // request for a context attribute, handled by tomcat
  + if( ! k.startsWith( "org.apache.tomcat" ) )
  + return null;
  + if (k.equals("org.apache.tomcat.jsp_classpath")) {
  + return getClassPath(ctx);
  + }
  + if(k.equals("org.apache.tomcat.classloader")) {
  + return ctx.getClassLoader();
  + }
  +
  + }
  + return null;
  +}
   
  +static Jdk11Compat jdkProxy=Jdk11Compat.getJdkCompat();
  +
  +private String getClassPath(Context ctx) {
  + StringBuffer cpath=new StringBuffer();
  + // local context class path
  + URL classPaths[]=ctx.getClassPath();
  + convertClassPath( cpath , classPaths );
  +
  +ClassLoader parentLoader=ctx.getContextManager().getParentLoader();
  + // apps class path 
  + convertClassPath(cpath, jdkProxy.getParentURLs(parentLoader));
  + // common class loader
  + convertClassPath(cpath, jdkProxy.getURLs(parentLoader));
  + if( debug>9 )
  + log("Getting classpath " + cpath);
  + return cpath.toString();
  +}
  +
  +private void convertClassPath( StringBuffer cpath, URL classPaths[] ) {
  + if( classPaths==null ) return;
  + for(int i=0; i< classPaths.length ; i++ ) {
  + URL cp = classPaths[i];
  + if (cpath.length()>0) cpath.append( separator );
  + cpath.append(cp.getFile());
  + }
  +}
  +
   static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
   
   private void getJars(Vector v, File f) {
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-03-09 Thread costin

costin  01/03/09 23:22:20

  Modified:src/facade22/org/apache/tomcat/facade JspInterceptor.java
   src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Removed: .ant.dtd
  Log:
  Remove ant.dtd ( it's outdated and not needed )
  
  Revision  ChangesPath
  1.18  +1 -1  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java
  
  Index: JspInterceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JspInterceptor.java   2001/03/09 23:33:59 1.17
  +++ JspInterceptor.java   2001/03/10 07:22:20 1.18
  @@ -444,7 +444,7 @@
if( h!= null ) {
log( "Name already exists " + servletName +
 " while mapping " + uri);
  - return null; // exception ?
  + return (ServletHandler)h; // exception ?
}

ServletHandler wrapper=new ServletHandler();
  
  
  
  1.10  +0 -1  
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LoaderInterceptor11.java  2001/03/09 23:47:39 1.9
  +++ LoaderInterceptor11.java  2001/03/10 07:22:20 1.10
  @@ -62,7 +62,6 @@
   import org.apache.tomcat.core.*;
   import org.apache.tomcat.util.*;
   import org.apache.tomcat.util.compat.*;
  -import org.apache.tomcat.util.depend.*;
   import java.io.*;
   import java.net.*;
   import java.util.*;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java

2001-03-07 Thread costin

costin  01/03/07 15:51:08

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Log:
  Simplified reloading - the DependManager is set by ReloadInterceptor,
  if the user wants to enable reloading.
  
  LoaderInterceptor will use it if available, but will not force reloading
  ( as before ) if the user doesn't have ReloadInterceptor.
  
  Also, on reload we just reset the DependManager ( and create a new
  class loader, as normal )
  
  Revision  ChangesPath
  1.8   +27 -18
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LoaderInterceptor11.java  2001/02/27 16:56:24 1.7
  +++ LoaderInterceptor11.java  2001/03/07 23:51:08 1.8
  @@ -151,11 +151,9 @@
   
DependManager dm=(DependManager)context.getContainer().
getNote("DependManager");
  - //context.getDependManager();
  +
if( dm==null ) {
  - dm=new DependManager();
  - context.getContainer().setNote("DependManager", dm);
  - //setDependManager( dm );
  + // No depend manager - that means no ReloadInterceptor.
}
   
ClassLoader parent=null;
  @@ -166,22 +164,30 @@
else
parent=this.getClass().getClassLoader();
   
  - // Construct a class loader. Use URLClassLoader if Java2,
  - // replacement ( SimpleClassLoader ) if not
  - //  SimpleClassLoader loader=new SimpleClassLoader(classP, parent);
ClassLoader loader=jdk11Compat.newClassLoaderInstance( classP, parent);
  - DependClassLoader dcl=new DependClassLoader( dm, loader);
if( debug > 0 )
log("Loader " + loader.getClass().getName() + " " + parent);
  - context.setClassLoader( dcl );
  +
  + if( dm != null ) {
  + // If depend manager is present, create a wrapper loader
  + // that will add dependencies for reloading ( using depentManager)
  + loader=new DependClassLoader( dm, loader);
  + }
  + // If another reloading scheme is implemented, you'll
  + // have to plug it in here.
  + 
  + context.setClassLoader( loader );
  +
// support for jasper and other applications
  - context.setAttribute( "org.apache.tomcat.classloader",
  -   context.getClassLoader());
  + context.setAttribute( "org.apache.tomcat.classloader",loader);
   }
   
   public void reload( Request req, Context context) throws TomcatException {
log( "Reload event " + context.getPath() );

  + DependManager dm=(DependManager)context.getContainer().
  + getNote("DependManager");
  +
ContextManager cm = context.getContextManager();
URL urls[]=context.getClassPath();
if( debug>5 ) {
  @@ -190,9 +196,11 @@
log("" + urls[i].toString() );
}
   
  - DependManager dm=new DependManager();
  - context.getContainer().setNote("DependManager", dm);
  - //setDependManager( dm );
  + if( dm!=null ) {
  + // we are using a util.depend for reloading
  + dm.reset();
  + }
  + // construct a new loader
ClassLoader oldLoader=context.getClassLoader();
int oldLoaderNote=cm.getNoteId( ContextManager.CONTAINER_NOTE,
"oldLoader");
  @@ -210,10 +218,11 @@
// replacement ( SimpleClassLoader ) if not
//  SimpleClassLoader loader=new SimpleClassLoader(urls, parent);
ClassLoader loader=jdk11Compat.newClassLoaderInstance( urls, parent);
  - DependClassLoader dcl=new DependClassLoader( dm, loader);
  - context.setClassLoader( dcl );
  - context.setAttribute( "org.apache.tomcat.classloader",
  -   ctx.getClassLoader());
  +
  + if( dm!=null ) 
  + loader=new DependClassLoader( dm, loader);
  + context.setClassLoader( loader );
  + context.setAttribute( "org.apache.tomcat.classloader", loader);
   }
   
   // 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java LoaderInterceptor12.java

2001-01-28 Thread costin

costin  01/01/28 11:20:35

  Modified:src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java
  Removed: src/share/org/apache/tomcat/modules/config
LoaderInterceptor12.java
  Log:
  Removed old LoaderInterceptor12, no longer needed ( util.compat ).
  
  LoaderInterceptor11 will set the class loader attribute ( needed at
  least in jasper's JspServlet - but maybe in other application )
  
  Revision  ChangesPath
  1.5   +5 -0  
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LoaderInterceptor11.java  2001/01/25 05:07:36 1.4
  +++ LoaderInterceptor11.java  2001/01/28 19:20:34 1.5
  @@ -171,6 +171,9 @@
if( debug > 0 )
log("Loader " + loader.getClass().getName() + " " + parent);
context.setClassLoader( dcl );
  + // support for jasper and other applications
  + context.setAttribute( "org.apache.tomcat.classloader",
  +   context.getClassLoader());
   }
   
   public void reload( Request req, Context context) throws TomcatException {
  @@ -205,6 +208,8 @@
ClassLoader loader=jdk11Compat.newClassLoaderInstance( urls, parent);
DependClassLoader dcl=new DependClassLoader( dm, loader);
context.setClassLoader( dcl );
  + context.setAttribute( "org.apache.tomcat.classloader",
  +   ctx.getClassLoader());
   }
   
   // 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java LoaderInterceptor12.java

2001-01-06 Thread larryi

larryi  01/01/06 17:53:55

  Modified:src/facade22/org/apache/tomcat/facade JspInterceptor.java
   src/share/org/apache/tomcat/modules/config
LoaderInterceptor11.java LoaderInterceptor12.java
  Log:
  The URLClassLoader in Sun's JDK1.2.2 for Windows has trouble loading
  classes from file URL's that have '\' characters in the file string. Make sure
  the file URL's contain only '/' characters so LoaderInterceptor12 will work
  with JDK1.2.2 on Windows.
  
  For consistency, updated LoaderInterceptor11 set file URLs the contain
  only '/' characters too.
  
  Updated logging in LoaderInterceptor11 and LoaderInterceptor12
  to show list of classpath URLs.
  
  Revision  ChangesPath
  1.2   +3 -1  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java
  
  Index: JspInterceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspInterceptor.java   2000/12/27 17:15:03 1.1
  +++ JspInterceptor.java   2001/01/07 01:53:55 1.2
  @@ -115,8 +115,10 @@
JspFactory.setDefaultFactory(new JspFactoryImpl());
   
try {
  + // Note: URLClassLoader in JDK1.2.2 doesn't work with file URLs
  + // that contain '\' characters.  Insure only '/' is used.
URL url=new URL( "file", null,
  -  ctx.getWorkDir().getAbsolutePath() + "/");
  + ctx.getWorkDir().getAbsolutePath().replace('\\','/') + "/");
ctx.addClassPath( url );
if( debug > 9 ) log( "Added to classpath: " + url );
} catch( MalformedURLException ex ) {
  
  
  
  1.3   +19 -7 
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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LoaderInterceptor11.java  2001/01/01 02:07:23 1.2
  +++ LoaderInterceptor11.java  2001/01/07 01:53:55 1.3
  @@ -90,7 +90,10 @@
   // Thanks for Kevin Jones for providing the fix.
if( dir.exists() ) {
try {
  - URL url=new URL( "file", null, dir.getAbsolutePath() + "/" );
  + // Note: URLClassLoader in JDK1.2.2 doesn't work with file URLs
  + // that contain '\' characters.  Insure only '/' is used.
  + URL url=new URL( "file", null,
  + dir.getAbsolutePath().replace('\\','/') + "/" );
context.addClassPath( url );
} catch( MalformedURLException ex ) {
}
  @@ -103,7 +106,9 @@
for(int i=0; i < jars.size(); ++i) {
String jarfile = (String) jars.elementAt(i);
File jf=new File(f, jarfile );
  - String absPath=jf.getAbsolutePath();
  + // Note: URLClassLoader in JDK1.2.2 doesn't work with file URLs
  + // that contain '\' characters.  Insure only '/' is used.
  + String absPath=jf.getAbsolutePath().replace('\\','/');
try {
URL url=new URL( "file", null, absPath );
context.addClassPath( url );
  @@ -117,13 +122,15 @@
   public void contextInit( Context context)
throws TomcatException
   {
  + if( debug>0 ) log( "Init context " + context.getPath());
   ContextManager cm = context.getContextManager();
  - 
URL classP[]=context.getClassPath();
  - if( debug > 0 ) {
  - for( int i=0; i< classP.length ; i++ )
  - log ( "Set classpath " + classP[i] );
  + if( debug>5 ) {
  + log("  Context classpath URLs:");
  + for (int i = 0; i < classP.length; i++)
  + log("" + classP[i].toString() );
}
  +
DependManager dm=context.getDependManager();
if( dm==null ) {
dm=new DependManager();
  @@ -140,10 +147,15 @@
   }
   
   public void reload( Request req, Context context) throws TomcatException {
  - log( "Reload event " );
  + log( "Reload event " + context.getPath() );

ContextManager cm = context.getContextManager();
URL urls[]=context.getClassPath();
  + if( debug>5 ) {
  + log("  Context classpath URLs:");
  + for (int i = 0; i < urls.length; i++)
  + log("" + urls[i].toString() );
  + }
   
DependManager dm=new DependManager();
context.setDependManager( dm );
  
  
  
  1.3   +18 -3 
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LoaderInterceptor12.java
  
  Index: LoaderInterceptor12.java
  ===