summaryrefslogtreecommitdiff
path: root/libjava/gnu/gcj/runtime/VMClassLoader.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-04-01 19:19:13 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-04-01 19:19:13 +0000
commitef87438639663154314e2cc5cd692eddaebfc799 (patch)
tree3d09f5cb569908269df7399fc0b8e4ca62d64f71 /libjava/gnu/gcj/runtime/VMClassLoader.java
parent35913faefbd7d9de8847f449ac4fd750b383e75f (diff)
natVMClassLoader.cc (getSystemClassLoaderInternal): Updated for name change.
* java/lang/natVMClassLoader.cc (getSystemClassLoaderInternal): Updated for name change. (nativeFindClass): New method. (loadClass): Use nativeFindClass. * java/lang/natClassLoader.cc (_Jv_FindClass): Use single-argument form of loadClass. * java/lang/VMClassLoader.java (tried_libraries, lib_control, LIB_FULL, LIB_CACHE, LIB_NEVER): New fields from old VMClassLoader. (initialize): New method. (nativeFindClass): Declare. * gnu/gcj/runtime/natVMClassLoader.cc: Removed. * gnu/gcj/runtime/VMClassLoader.java: Removed. * gnu/gcj/runtime/ExtensionClassLoader.java: Renamed from VMClassLoader.java. (definePackageForNative): Removed. (tried_libraries, LIB_CACHE, LIB_FULL, LIB_NEVER, lib_control): Moved to VMClassLoader.java. * prims.cc (_Jv_CreateJavaVM): Updated for renaming. * Makefile.am (gnu/gcj/runtime/ExtensionClassLoader.h): Renamed. (ordinary_java_source_files): Added ExtensionClassLoader.java, removed VMClassLoader.java. (nat_source_files): Removed natVMClassLoader.cc. From-SVN: r97414
Diffstat (limited to 'libjava/gnu/gcj/runtime/VMClassLoader.java')
-rw-r--r--libjava/gnu/gcj/runtime/VMClassLoader.java94
1 files changed, 0 insertions, 94 deletions
diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java
deleted file mode 100644
index 1ed0c026cf8..00000000000
--- a/libjava/gnu/gcj/runtime/VMClassLoader.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
-
- This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
-/* Author: Kresten Krab Thorup <krab@gnu.org> */
-
-package gnu.gcj.runtime;
-
-import java.net.URL;
-import java.util.HashSet;
-
-// Despite its name, this class is really the extension loader for
-// libgcj. Class loader bootstrap is a bit tricky, see prims.cc and
-// SystemClassLoader for some details.
-public final class VMClassLoader extends HelperClassLoader
-{
- private VMClassLoader ()
- {
- String p
- = System.getProperty ("gnu.gcj.runtime.VMClassLoader.library_control",
- "");
- if ("never".equals(p))
- lib_control = LIB_NEVER;
- else if ("cache".equals(p))
- lib_control = LIB_CACHE;
- else if ("full".equals(p))
- lib_control = LIB_FULL;
- else
- lib_control = LIB_CACHE;
- }
-
- private void init()
- {
- addDirectoriesFromProperty("java.ext.dirs");
- }
-
- /** This is overridden to search the internal hash table, which
- * will only search existing linked-in classes. This will make
- * the default implementation of loadClass (in ClassLoader) work right.
- * The implementation of this method is in
- * gnu/gcj/runtime/natVMClassLoader.cc.
- */
- protected native Class findClass(String name)
- throws java.lang.ClassNotFoundException;
-
- // This can be package-private because we only call it from native
- // code during startup.
- static void initialize ()
- {
- instance.init();
- system_instance.init();
- }
-
- // Define a package for something loaded natively.
- void definePackageForNative(String className)
- {
- int lastDot = className.lastIndexOf('.');
- if (lastDot != -1)
- {
- String packageName = className.substring(0, lastDot);
- if (getPackage(packageName) == null)
- {
- // FIXME: this assumes we're defining the core, which
- // isn't necessarily so. We could detect this and set up
- // appropriately. We could also look at a manifest file
- // compiled into the .so.
- definePackage(packageName, "Java Platform API Specification",
- "GNU", "1.4", "gcj", "GNU",
- null, // FIXME: gcj version.
- null);
- }
- }
- }
-
- // This keeps track of shared libraries we've already tried to load.
- private HashSet tried_libraries = new HashSet();
-
- // Holds one of the LIB_* constants; used to determine how shared
- // library loads are done.
- private int lib_control;
-
- // The only VMClassLoader that can exist.
- static VMClassLoader instance = new VMClassLoader();
- // The system class loader.
- static SystemClassLoader system_instance = new SystemClassLoader(instance);
-
- private static final int LIB_FULL = 0;
- private static final int LIB_CACHE = 1;
- private static final int LIB_NEVER = 2;
-}