public abstract class ScriptClassLoader extends URLClassLoader
| Constructor and Description |
|---|
ScriptClassLoader(URL[] urls)
Just for compatibility with
URLClassLoader |
ScriptClassLoader(URL[] urls,
ClassLoader parent)
Just for compatibility with
URLClassLoader |
ScriptClassLoader(URL[] urls,
ClassLoader parent,
URLStreamHandlerFactory factory)
Just for compatibility with
URLClassLoader |
| Modifier and Type | Method and Description |
|---|---|
void |
addJarFile(File file)
Adds library to this classloader, it shuould be jar file
|
abstract byte[] |
getByteCode(String className)
Returns bytecode for given className.
|
abstract Set<String> |
getCompiledClasses()
Retuns unmodifiable set of class names that were compiled
|
abstract Class<?> |
getDefinedClass(String name)
Returns cached class instance for give name or null if is not cached yet
|
protected Set<String> |
getLibraryClassNames() |
URL |
getResource(String name) |
Class<?> |
loadClass(String name)
Loads class from library, parent or compiled
|
abstract void |
setDefinedClass(String name,
Class<?> clazz)
Sets defined class into cache
|
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic ScriptClassLoader(URL[] urls, ClassLoader parent)
URLClassLoaderurls - list of urlsparent - parent classloaderpublic ScriptClassLoader(URL[] urls)
URLClassLoaderurls - list of urlspublic ScriptClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
URLClassLoaderurls - list of urlsparent - parent classloaderfactory - URLStreamHandlerFactorypublic void addJarFile(File file) throws IOException
file - jar fileIOException - if can't add librarypublic URL getResource(String name)
getResource in class ClassLoaderpublic Class<?> loadClass(String name) throws ClassNotFoundException
loadClass in class ClassLoadername - class to loadClassNotFoundException - if class not foundpublic abstract Set<String> getCompiledClasses()
public abstract byte[] getByteCode(String className)
className - class namepublic abstract Class<?> getDefinedClass(String name)
name - class namepublic abstract void setDefinedClass(String name, Class<?> clazz) throws IllegalArgumentException
name - class nameclazz - class objectIllegalArgumentException - if class was not loaded by this class loaderCopyright © 2014–2015. All rights reserved.