From 7b97a1314d2349dcdbebc663579011c75a281d70 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 5 Nov 2003 11:50:48 +0000 Subject: [PATCH] By default use system class path in helma class loader, but allow for -Dhelma.exludeSystemClasses=true switch to exclude it. --- src/helma/main/launcher/Main.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/helma/main/launcher/Main.java b/src/helma/main/launcher/Main.java index f669339d..d51f29ce 100644 --- a/src/helma/main/launcher/Main.java +++ b/src/helma/main/launcher/Main.java @@ -38,11 +38,12 @@ public class Main { }; /** + * Helma boot method. This retrieves the Helma home directory, creates the + * classpath and invokes main() in helma.main.Server. * + * @param args command line arguments * - * @param args ... - * - * @throws Exception ... + * @throws Exception if the Helma home dir or classpath couldn't be built */ public static void main(String[] args) throws Exception { // check if home directory is set via command line arg. If not, @@ -134,7 +135,16 @@ public class Main { jarlist.toArray(urls); - FilteredClassLoader loader = new FilteredClassLoader(urls); + // find out if system classes should be excluded from class path + String excludeSystemClasses = System.getProperty("helma.excludeSystemClasses"); + + FilteredClassLoader loader; + + if ("true".equalsIgnoreCase(excludeSystemClasses)) { + loader = new FilteredClassLoader(urls, null); + } else { + loader = new FilteredClassLoader(urls); + } // set the new class loader as context class loader Thread.currentThread().setContextClassLoader(loader);