public class ChunkClassLoader extends ClassLoader
Constructor and Description |
---|
ChunkClassLoader()
Constructs a new
ChunkClassLoader using the class loader that loaded
the ChunkClassLoader class as the parent class loader. |
ChunkClassLoader(ClassLoader parent)
Constructs a new
ChunkClassLoader with the specified class loader parent
as its parent in the class loading hierarchy. |
Modifier and Type | Method and Description |
---|---|
protected Class<?> |
findClass(String name) |
String |
install(CompiledChunk chunk)
Installs the compiled chunk
chunk into this chunk class loader, returning
the class name of the main class in chunk . |
boolean |
isInstalled(String className)
Returns
true if the Lua function class with the given className
has been installed into this ChunkClassLoader or has already been loaded by it. |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ChunkClassLoader(ClassLoader parent)
ChunkClassLoader
with the specified class loader parent
as its parent in the class loading hierarchy.parent
- the parent class loaderpublic ChunkClassLoader()
ChunkClassLoader
using the class loader that loaded
the ChunkClassLoader
class as the parent class loader.public String install(CompiledChunk chunk)
chunk
into this chunk class loader, returning
the class name of the main class in chunk
.
Once this method returns (and not before), the returned main class may be loaded and instantiated.
chunk
- chunk to be installed, must not be null
chunk
NullPointerException
- if chunk
is null
IllegalStateException
- if a class with the same name as a class in chunk
has already been installed into this chunk class loaderpublic boolean isInstalled(String className)
true
if the Lua function class with the given className
has been installed into this ChunkClassLoader
or has already been loaded by it.className
- class name of the Lua function, must not be null
true
iff the class className
has been installed into this
class loader or loaded by itNullPointerException
- if className
is null
protected Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class ClassLoader
ClassNotFoundException
Copyright © 2016. All rights reserved.