APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot

public Class SALauncherLoader

extends URLClassLoader
Class Inheritance
Imports
java.io.*, java.net.*, java.util.*, java.security.*

SA uses native debugger back-end library - libsaproc.so on Unix platforms. Starting from 5.0, in Solaris & Linux JDK "libsaproc.so" is shipped with JDK and is kept jre/lib/cpu directory (where all other JDK platform libraries are kept). This implies that always that jre copy of libsaproc.so will be used and the copy of libsaproc.so built from SA sources here will not be used at all. We can override libsaproc.so using this class loader as System class loader using "java.system.class.loader" property. This class loader loads classes paths specified paths using the System property "java.class.path". Because, this class loader loads SA debugger classes (among other classes), JVM calls findLibrary override here. In this findLibrary, we first check the library in the directories specified through "sa.library.path" System property. This way updated/latest SA native library can be loaded instead of the one from JDK's jre/lib directory.

Field Summary

Modifier and TypeField and Description
private String[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
findLibrary(String name)

Overrides java.lang.ClassLoader.findLibrary.

Checks native libraries under directories specified using the System property "sa.library.path".

private static URL[]
private static File[]
private static URL
public synchronized Class<T>
loadClass(String name, boolean resolve)

Overrides java.lang.ClassLoader.loadClass.

Override loadClass so we can checkPackageAccess.

private static URL[]
pathToURLs(File[] path)

Inherited from java.net.URLClassLoader:
addURLclosedefinePackagefindClassfindResourcefindResourcesgetPermissionsgetResourceAsStreamgetURLsnewInstancenewInstance

Field Detail

libpathsback to summary
private String[] libpaths

Constructor Detail

SALauncherLoaderback to summary
public SALauncherLoader(ClassLoader parent)

Method Detail

findLibraryback to summary
public String findLibrary(String name)

Overrides java.lang.ClassLoader.findLibrary.

Checks native libraries under directories specified using the System property "sa.library.path".

getClassPathback to summary
private static URL[] getClassPath()
getClassPathback to summary
private static File[] getClassPath(String cp)
getFileURLback to summary
private static URL getFileURL(File file)
loadClassback to summary
public synchronized Class<T> loadClass(String name, boolean resolve) throws ClassNotFoundException

Overrides java.lang.ClassLoader.loadClass.

Override loadClass so we can checkPackageAccess.

Exceptions
ClassNotFoundException:

Doc from java.lang.ClassLoader.loadClass.

If the class could not be found

pathToURLsback to summary
private static URL[] pathToURLs(File[] path)