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/startup Main.java
Date Sat, 10 Feb 2001 16:13:33 GMT
costin      01/02/10 08:13:33

  Modified:    src/share/org/apache/tomcat/startup Main.java
  Log:
  Use Jdk11Compat instead of introspection.
  
  Revision  Changes    Path
  1.23      +19 -20    jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Main.java	2001/02/10 15:56:33	1.22
  +++ Main.java	2001/02/10 16:13:33	1.23
  @@ -66,13 +66,12 @@
   import java.util.*;
   import java.net.*;
   
  -// XXX This should be replaced by JdkCompat
  -import org.apache.tomcat.util.compat.SimpleClassLoader;
   import org.apache.tomcat.util.IntrospectionUtils;
  +import org.apache.tomcat.util.compat.Jdk11Compat;
   
   // Depends:
   // JDK1.1
  -// tomcat.util.IntrospectionUtils, SimpleClassLoader
  +// tomcat.util.IntrospectionUtils, util.compat
   
   /**
    * Starter for Tomcat.
  @@ -167,7 +166,8 @@
   	return commonBase;
       }
   
  -
  +    static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
  +    
       void execute( String args[] ) throws Exception {
   
           try {
  @@ -182,30 +182,29 @@
               Vector serverUrlV =getClassPathV(getServerDir());
               for(int i=0; i < serverUrlV.size();i++)
                   urlV.addElement(serverUrlV.elementAt(i));
  -	    urlV.addElement( new URL( "file", null , System.getProperty( "java.home" ) +"/../lib/tools.jar"));
  +	    urlV.addElement( new URL( "file", null ,
  +				      System.getProperty( "java.home" ) +
  +				      "/../lib/tools.jar"));
               URL[] serverClassPath=getURLs(urlV);
  -            // ClassLoader for webapps it uses a shared dir as repository, distinct from
lib
  +            // ClassLoader for webapps it uses a shared dir as repository,
  +	    // distinct from lib
   
               URL[] sharedClassPath=getURLs(getClassPathV(getSharedDir()));
               URL[] commonClassPath=getURLs(getClassPathV(getCommonDir()));
  -	    // XXX Should be: JdkCompat.newClassLoaderInstance !!
  -	    ClassLoader commonCl= IntrospectionUtils.getURLClassLoader(commonClassPath , parentL
);
  -	    ClassLoader sharedCl= IntrospectionUtils.getURLClassLoader(sharedClassPath , commonCl
);
  -            ClassLoader serverCl= IntrospectionUtils.getURLClassLoader(serverClassPath
, commonCl );
  -	    if( commonCl==null ) {
  -		commonCl=new SimpleClassLoader(commonClassPath, parentL);
  -		sharedCl=new SimpleClassLoader(sharedClassPath, commonCl);
  -		serverCl=new SimpleClassLoader(serverClassPath, commonCl);
  -            }
  -
  -            //System.out.println("commonCl:"+commonCl);
  -            //System.out.println("sharedCl:"+sharedCl);
  -            //System.out.println("serverCl:"+serverCl);
  +
  +	    ClassLoader commonCl=
  +		jdk11Compat.newClassLoaderInstance(commonClassPath , parentL );
  +	    ClassLoader sharedCl=
  +		jdk11Compat.newClassLoaderInstance(sharedClassPath ,commonCl );
  +            ClassLoader serverCl=
  +		jdk11Compat.newClassLoaderInstance(serverClassPath ,commonCl);
  +
   	    Class cls=serverCl.loadClass("org.apache.tomcat.startup.Tomcat");
   	    Object proxy=cls.newInstance();
   
               IntrospectionUtils.setAttribute( proxy,"args", args );
  -            IntrospectionUtils.setAttribute( proxy,"parentClassLoader", sharedCl );
  +            IntrospectionUtils.setAttribute( proxy,"parentClassLoader",
  +					     sharedCl );
               IntrospectionUtils.execute(  proxy, "executeWithAttributes" );
   	    return;
   	} catch( Exception ex ) {
  
  
  

Mime
View raw message