< prev index next >

src/java.base/share/classes/jdk/internal/loader/BootLoader.java

Print this page


  48 import jdk.internal.util.StaticProperty;
  49 
  50 /**
  51  * Find resources and packages in modules defined to the boot class loader or
  52  * resources and packages on the "boot class path" specified via -Xbootclasspath/a.
  53  */
  54 
  55 public class BootLoader {
  56     private BootLoader() { }
  57 
  58     // The unnamed module for the boot loader
  59     private static final Module UNNAMED_MODULE;
  60     private static final String JAVA_HOME = StaticProperty.javaHome();
  61 
  62     static {
  63         UNNAMED_MODULE = SharedSecrets.getJavaLangAccess().defineUnnamedModule(null);
  64         setBootLoaderUnnamedModule0(UNNAMED_MODULE);
  65     }
  66 
  67     // ServiceCatalog for the boot class loader
  68     private static final ServicesCatalog SERVICES_CATALOG = ServicesCatalog.create();








  69 
  70     // ClassLoaderValue map for the boot class loader
  71     private static final ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP
  72         = new ConcurrentHashMap<>();
  73 
  74     // native libraries loaded by the boot class loader
  75     private static final NativeLibraries NATIVE_LIBS
  76         = NativeLibraries.jniNativeLibraries(null);
  77 
  78     /**
  79      * Returns the unnamed module for the boot loader.
  80      */
  81     public static Module getUnnamedModule() {
  82         return UNNAMED_MODULE;
  83     }
  84 
  85     /**
  86      * Returns the ServiceCatalog for modules defined to the boot class loader.
  87      */
  88     public static ServicesCatalog getServicesCatalog() {




  48 import jdk.internal.util.StaticProperty;
  49 
  50 /**
  51  * Find resources and packages in modules defined to the boot class loader or
  52  * resources and packages on the "boot class path" specified via -Xbootclasspath/a.
  53  */
  54 
  55 public class BootLoader {
  56     private BootLoader() { }
  57 
  58     // The unnamed module for the boot loader
  59     private static final Module UNNAMED_MODULE;
  60     private static final String JAVA_HOME = StaticProperty.javaHome();
  61 
  62     static {
  63         UNNAMED_MODULE = SharedSecrets.getJavaLangAccess().defineUnnamedModule(null);
  64         setBootLoaderUnnamedModule0(UNNAMED_MODULE);
  65     }
  66 
  67     // ServiceCatalog for the boot class loader
  68     private static final ServicesCatalog SERVICES_CATALOG;
  69     static {
  70         ArchivedClassLoaders archivedClassLoaders = ArchivedClassLoaders.get();
  71         if (archivedClassLoaders != null) {
  72             SERVICES_CATALOG = archivedClassLoaders.servicesCatalog(null);
  73         } else {
  74             SERVICES_CATALOG = ServicesCatalog.create();
  75         }
  76     }
  77 
  78     // ClassLoaderValue map for the boot class loader
  79     private static final ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP
  80         = new ConcurrentHashMap<>();
  81 
  82     // native libraries loaded by the boot class loader
  83     private static final NativeLibraries NATIVE_LIBS
  84         = NativeLibraries.jniNativeLibraries(null);
  85 
  86     /**
  87      * Returns the unnamed module for the boot loader.
  88      */
  89     public static Module getUnnamedModule() {
  90         return UNNAMED_MODULE;
  91     }
  92 
  93     /**
  94      * Returns the ServiceCatalog for modules defined to the boot class loader.
  95      */
  96     public static ServicesCatalog getServicesCatalog() {


< prev index next >