final class PreferredFactoryClassLoader extends PreferredClassLoader
Constructor and Description |
---|
PreferredFactoryClassLoader(URL[] urls,
ClassLoader parent,
String exportAnnotation,
boolean requireDownloadPerm) |
Modifier and Type | Method and Description |
---|---|
Class |
loadClass(String name,
boolean resolve)
Loads a class with the specified name.
|
addPermissionsForURLs, checkPermissions, definePackage, getClassAnnotation, getLoaderAccessControlContext, getPermissions, getResource, getResources, isPreferredResource, newInstance, toString, urlsToPath
addURL, close, definePackage, findClass, findResource, findResources, getURLs, newInstance, newInstance
getResourceAsStream
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
PreferredFactoryClassLoader(URL[] urls, ClassLoader parent, String exportAnnotation, boolean requireDownloadPerm)
public final Class loadClass(String name, boolean resolve) throws ClassNotFoundException
PreferredClassLoader
PreferredClassLoader
implements this method as
follows:
This method first invokes findLoadedClass
with name
; if
findLoadedClass
returns a non-null
Class
, then this method returns that
Class
.
Otherwise, this method invokes isPreferredResource
with name
as the first
argument and true
as the second argument:
isPreferredResource
throws an
IOException
, then this method throws a
ClassNotFoundException
containing the
IOException
as its cause.
isPreferredResource
returns
true
, then this method invokes findClass
with name
. If findClass
throws an exception, then this method throws that exception.
Otherwise, this method returns the Class
returned
by findClass
, and if resolve
is
true
, resolveClass
is
invoked with the Class
before returning.
isPreferredResource
returns
false
, then this method invokes the superclass
implementation of loadClass
with name
and resolve
and
returns the result. If the superclass's loadClass
throws an exception, then this method throws that exception.
loadClass
in class PreferredClassLoader
name
- the binary name of the class to loadresolve
- if true
, then resolveClass
will be invoked with the loaded class before
returningClassNotFoundException
- if the class could not be foundCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.