From tomcat-dev-return-22425-qmlist-jakarta-archive-tomcat-dev=jakarta.apache.org@jakarta.apache.org Mon Dec 02 10:38:24 2002 Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 58428 invoked from network); 2 Dec 2002 10:38:24 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Dec 2002 10:38:24 -0000 Received: (qmail 12010 invoked by uid 97); 2 Dec 2002 10:39:35 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 11971 invoked by uid 97); 2 Dec 2002 10:39:34 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 11960 invoked by uid 97); 2 Dec 2002 10:39:33 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 2 Dec 2002 10:38:12 -0000 Message-ID: <20021202103812.70567.qmail@icarus.apache.org> From: remm@apache.org To: jakarta-tomcat-catalina-cvs@apache.org Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Bootstrap.java ClassLoaderFactory.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N remm 2002/12/02 02:38:11 Modified: catalina/src/share/org/apache/catalina/startup Bootstrap.java ClassLoaderFactory.java Log: - Add the possibility to specify remote codebases. Revision Changes Path 1.8 +15 -5 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java Index: Bootstrap.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Bootstrap.java 26 Oct 2002 12:29:56 -0000 1.7 +++ Bootstrap.java 2 Dec 2002 10:38:11 -0000 1.8 @@ -97,6 +97,7 @@ protected static final String CATALINA_TOKEN = "${catalina.home}"; + protected static final String HTTP_TOKEN = "http://"; // ------------------------------------------------------- Static Variables @@ -153,10 +154,17 @@ ArrayList unpackedList = new ArrayList(); ArrayList packedList = new ArrayList(); + ArrayList urlList = new ArrayList(); StringTokenizer tokenizer = new StringTokenizer(value, ","); while (tokenizer.hasMoreElements()) { String repository = tokenizer.nextToken(); + // Check for a remote repository + if (repository.startsWith(HTTP_TOKEN)) { + urlList.add(new URL(repository)); + continue; + } + // Local repository boolean packed = false; if (repository.startsWith(CATALINA_TOKEN)) { repository = getCatalinaHome() @@ -176,8 +184,10 @@ File[] unpacked = (File[]) unpackedList.toArray(new File[0]); File[] packed = (File[]) packedList.toArray(new File[0]); + URL[] urls = (URL[]) urlList.toArray(new URL[0]); - return ClassLoaderFactory.createClassLoader(unpacked, packed, parent); + return ClassLoaderFactory.createClassLoader + (unpacked, packed, urls, parent); } 1.3 +39 -4 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ClassLoaderFactory.java Index: ClassLoaderFactory.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ClassLoaderFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ClassLoaderFactory.java 24 Oct 2002 13:53:22 -0000 1.2 +++ ClassLoaderFactory.java 2 Dec 2002 10:38:11 -0000 1.3 @@ -152,6 +152,34 @@ File packed[], ClassLoader parent) throws Exception { + return createClassLoader(unpacked, packed, null, parent); + } + + + /** + * Create and return a new class loader, based on the configuration + * defaults and the specified directory paths: + * + * @param unpacked Array of pathnames to unpacked directories that should + * be added to the repositories of the class loader, or null + * for no unpacked directories to be considered + * @param packed Array of pathnames to directories containing JAR files + * that should be added to the repositories of the class loader, + * or null for no directories of JAR files to be considered + * @param urls Array of URLs to remote repositories, designing either JAR + * resources or uncompressed directories that should be added to + * the repositories of the class loader, or null for no + * directories of JAR files to be considered + * @param parent Parent class loader for the new class loader, or + * null for the system class loader. + * + * @exception Exception if an error occurs constructing the class loader + */ + public static ClassLoader createClassLoader(File unpacked[], + File packed[], + URL urls[], + ClassLoader parent) + throws Exception { if (debug >= 1) log("Creating new class loader"); @@ -193,6 +221,13 @@ file.getCanonicalPath()); list.add(url.toString()); } + } + } + + // Add remote URLs + if (urls != null) { + for (int i = 0; i < urls.length; i++) { + list.add(urls[i].toString()); } } -- To unsubscribe, e-mail: For additional commands, e-mail: