| java.net.URLClassLoader org.ow2.easybeans.loader.EasyBeansClassLoader
EasyBeansClassLoader | public class EasyBeansClassLoader extends URLClassLoader implements Cloneable(Code) | | This class defines the EasyBeans classloader. This classloader allows to set
the bytecode for a given class. Then, when the class will be loaded, it will
define the class by using the associated bytecode.
author: Florent Benoit |
Method Summary | |
public void | addClassDefinition(String className, byte[] bytecode) Adds the bytecode for a given class. | public void | addTransformer(ClassTransformer transformer) Add a transformer supplied by the provider that will be called for every
new class definition or class redefinition that gets loaded by the loader
returned by the PersistenceInfo.getClassLoader method. | public Object | clone() Creates and returns a copy of this object. | protected Class> | findClass(String name) Finds and loads the class with the specified name from the URL search
path. | public Class> | loadClass(String name) When trying to load a class, look if this class needs to be defined.
Parameters: name - the class name to load. | public String | toString() Displays useful information. |
EasyBeansClassLoader | public EasyBeansClassLoader(URL[] urls, ClassLoader parent)(Code) | | Use the same constructors as parent class.
Parameters: urls - the URLs from which to load classes and resources Parameters: parent - the parent class loader for delegation |
EasyBeansClassLoader | public EasyBeansClassLoader(URL[] urls)(Code) | | Use the same constructors as parent class.
Parameters: urls - the URLs from which to load classes and resources |
addClassDefinition | public void addClassDefinition(String className, byte[] bytecode)(Code) | | Adds the bytecode for a given class. It will be used when class will be
loaded.
Parameters: className - the name of the class. Parameters: bytecode - the bytes of the given class. |
addTransformer | public void addTransformer(ClassTransformer transformer)(Code) | | Add a transformer supplied by the provider that will be called for every
new class definition or class redefinition that gets loaded by the loader
returned by the PersistenceInfo.getClassLoader method. The transformer
has no effect on the result returned by the
PersistenceInfo.getTempClassLoader method. Classes are only transformed
once within the same classloading scope, regardless of how many
persistence units they may be a part of.
Parameters: transformer - A provider-supplied transformer that the Containerinvokes at class-(re)definition time |
clone | public Object clone()(Code) | | Creates and returns a copy of this object.
It is used for example when Persistence Provider needs a new Temp classloader to load some temporary classes.
a copy of this object |
findClass | protected Class> findClass(String name) throws ClassNotFoundException(Code) | | Finds and loads the class with the specified name from the URL search
path. If this classloader has the bytecode for the associated class, it
defines the class.
Parameters: name - the name of the class the resulting class exception: ClassNotFoundException - if the class could not be found |
toString | public String toString()(Code) | | Displays useful information.
information |
|
|