com.sun.faces.application
private class ConverterPropertyEditorFactory.DisposableClassLoader extends java.lang.ClassLoader
A custom class loader for the definition of the generated classes. When
the generated class is loaded, it will need to be able to resolve both
the base class (ConverterPropertyEditorBase
) which comes from
myLoader
and the target class which comes from
targetLoader
. This class loader defines only the
generated class, and delegates to the above two loaders for the rest.
The ConverterPropertyEditorFactory
will keep a cache of these
class loaders (via weak references), one for each class loader that the
target classes come from. That way the target class loader (which is
likely to be a webapp specific loader) can be disposed of and replaced
when the webapp is removed or reinstalled.
Modifier and Type | Field and Description |
---|---|
private java.lang.ClassLoader |
myLoader |
private java.lang.ClassLoader |
targetLoader |
Constructor and Description |
---|
ConverterPropertyEditorFactory.DisposableClassLoader(java.lang.ClassLoader targetLoader) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class<?> |
findClass(java.lang.String className)
If
super.loadClass is unable to locate a class, it
will call this method to define it. |
protected java.lang.Class<?> |
loadClass(java.lang.String name,
boolean resolve)
Override class loading to enable possible delegation to the two class
loaders, rather than just to the parent.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
private java.lang.ClassLoader targetLoader
private java.lang.ClassLoader myLoader
public ConverterPropertyEditorFactory.DisposableClassLoader(java.lang.ClassLoader targetLoader)
protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
protected java.lang.Class<?> findClass(java.lang.String className) throws java.lang.ClassNotFoundException
super.loadClass
is unable to locate a class, it
will call this method to define it. If the className
is a generated PropertyEditor class name, then create the new class.
Otherwise call super.findClass
which will throw a
ClassNotFoundException
.findClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.