3909N/A * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class is used by the system to launch the main application. 0N/A // Create the extension class loader 0N/A "Could not create extension class loader");
0N/A // Now create the class loader to use to launch the application 0N/A "Could not create application class loader");
0N/A // Also set the context class loader for the primordial thread. 0N/A // Finally, install a security manager if requested 0N/A "Could not create SecurityManager: " + s);
0N/A * Returns the class loader used to launch the main application. 0N/A * The class loader used for loading installed extensions. 0N/A * create an ExtClassLoader. The ExtClassLoader is created 0N/A * within a context that limits which files it can read 0N/A // Prior implementations of this doPrivileged() block supplied 0N/A // aa synthesized ACC via a call to the private method 0N/A // ExtClassLoader.getContext(). 0N/A for (
int i =
0; i <
len; i++) {
0N/A * Creates a new ExtClassLoader for the specified directories. 0N/A * Searches the installed extension directories for the specified 0N/A * library name. For each extension directory, we first look for 0N/A * the native library in the subdirectory whose name is the value 0N/A * of the system property <code>os.arch</code>. Failing that, we 0N/A * look in the extension directory itself. 1042N/A // Get the ext directory from the URL 1042N/A // Look in architecture-specific subdirectory first 2916N/A // Read from the saved system properties to avoid deadlock 1042N/A // Then check the extension directory 0N/A * The class loader used for loading from java.class.path. 0N/A * runs in a restricted security context. 0N/A // Note: on bugid 4256530 0N/A // Prior implementations of this doPrivileged() block supplied 0N/A // a rather restrictive ACC via a call to the private method 0N/A // AppClassLoader.getContext(). This proved overly restrictive 0N/A // when loading classes. Specifically it prevent 0N/A // accessClassInPackage.sun.* grants from being honored. 0N/A * Creates a new AppClassLoader 0N/A * Override loadClass so we can checkPackageAccess. 0N/A * allow any classes loaded from classpath to exit the VM. 0N/A * This class loader supports dynamic additions to the class path 0N/A * @see java.lang.instrument.Instrumentation#appendToSystemClassPathSearch 0N/A // addURL is a no-op if path already contains the URL 0N/A * create a context that can read any directories (recursively) 0N/A * mentioned in the class path. In the case of a jar, it has to 0N/A * be the directory containing the jar, not just the jar, as jar 0N/A * files might refer to other jar files. 1365N/A // Negative test used to properly handle 1365N/A // nonexistent jars on boot class path 0N/A //for (int i = 0; i < urls.length; i++) { 0N/A // System.out.println("urls[" + i + "] = " + '"' + urls[i] + '"'); 0N/A // Count the number of separators first 0N/A // Now scan for each path component 0N/A // empty path component translates to "." 0N/A // Make sure we include the last path component 0N/A // Trim array to correct size 0N/A //for (int i = 0; i < path.length; i++) { 0N/A // System.out.println("path[" + i + "] = " + '"' + path[i] + '"'); 0N/A // Should never happen since we specify the protocol... 0N/A * The stream handler factory for loading system protocol handlers. 0N/A "system protocol handler");
0N/A // use serialVersionUID from JDK 1.2.2 for interoperability 0N/A // this is needed to be able to create the classloader itself! 0N/A // add permission to read any "java.*" property