< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 69,78 **** --- 69,82 ---- // ClassLoaderValue map for the boot class loader private static final ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP = new ConcurrentHashMap<>(); + // native libraries loaded by the boot class loader + private static final NativeLibraries NATIVE_LIBS + = new NativeLibraries(null); + /** * Returns the unnamed module for the boot loader. */ public static Module getUnnamedModule() { return UNNAMED_MODULE;
*** 91,100 **** --- 95,111 ---- public static ConcurrentHashMap<?, ?> getClassLoaderValueMap() { return CLASS_LOADER_VALUE_MAP; } /** + * Returns NativeLibraries for the boot class loader. + */ + public static NativeLibraries getNativeLibraries() { + return NATIVE_LIBS; + } + + /** * Returns {@code true} if there is a class path associated with the * BootLoader. */ public static boolean hasClassPath() { return ClassLoaders.bootLoader().hasClassPath();
*** 127,153 **** return null; } } /** - * Loads a library from the system path. - */ - public static void loadLibrary(String library) { - if (System.getSecurityManager() == null) { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); - } else { - AccessController.doPrivileged( - new java.security.PrivilegedAction<>() { - public Void run() { - SharedSecrets.getJavaLangAccess().loadLibrary(BootLoader.class, library); - return null; - } - }); - } - } - - /** * Returns a URL to a resource in a module defined to the boot loader. */ public static URL findResource(String mn, String name) throws IOException { return ClassLoaders.bootLoader().findResource(mn, name); } --- 138,147 ----
< prev index next >