public final class FrameworkClassLoader extends URLClassLoader
The Framework is loaded in a different classloader to access the jar contained in the 'libs' directory. Notice that the framework jar must be in the Chameleon's classpath.
| Modifier and Type | Method and Description |
|---|---|
static ClassLoader |
getFrameworkClassLoader(File basedir)
Gets an instance of
FrameworkClassLoader. |
static boolean |
hasToBeDefined(String name)
Checks whether or not the given class name must be defined by the
.FrameworkClassLoader or by the parent class loader. |
static URL[] |
jars(File dir)
Builds a array of URLs containing all the jar file from the given directory.
|
Class |
loadClass(String name)
Loads a class.
|
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic static ClassLoader getFrameworkClassLoader(File basedir)
FrameworkClassLoader.basedir - the base directory. The 'libs' folder must be a direct child of this directory.public static boolean hasToBeDefined(String name)
.FrameworkClassLoader or by the parent class loader.
It checks if the class is in one of the packages listed in .FrameworkClassLoader#PREFIXES.
name - the class nametrue if the class must be defined by the framework's classloader, false otherwise.public Class loadClass(String name) throws ClassNotFoundException
If the byte code of the class cannot be found, it delegates to the parent.
Defined classes are stored, and not redefined.
loadClass in class ClassLoadername - the class nameClassNotFoundException - if the class cannot be foundpublic static URL[] jars(File dir)
dir - the directoryCopyright © 2009–2014 OW2 Chameleon. All rights reserved.