public class GoloClassLoader extends java.lang.ClassLoader
Golo source files can be compiled and the resulting JVM bytecode be injected into the class loader. It is important to note that this class loader definition is not thread safe.
This class loader does not support reloading. Attempts to load source files that may produce the same bytecode definitions will resulting in exceptions.
Constructor and Description |
---|
GoloClassLoader()
Creates a class loader from the default parent.
|
GoloClassLoader(java.lang.ClassLoader parent)
Creates a class loader from a parent.
|
Modifier and Type | Method and Description |
---|---|
GoloCompiler |
getCompiler() |
java.lang.Class<?> |
load(java.lang.String goloSourceFilename,
GoloModule module)
Compiles and loads the resulting JVM bytecode for a Golo module IR.
|
java.lang.Class<?> |
load(java.lang.String goloSourceFilename,
java.io.InputStream sourceCodeInputStream)
Compiles and loads the resulting JVM bytecode for a Golo source file.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, 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 GoloClassLoader(java.lang.ClassLoader parent)
parent
- the parent classloader.public GoloClassLoader()
public GoloCompiler getCompiler()
public java.lang.Class<?> load(java.lang.String goloSourceFilename, java.io.InputStream sourceCodeInputStream) throws GoloCompilationException
goloSourceFilename
- the source file name.sourceCodeInputStream
- the source input stream.GoloCompilationException
- if either of the compilation phase failed.public java.lang.Class<?> load(java.lang.String goloSourceFilename, GoloModule module)
goloSourceFilename
- the source file name.module
- the Golo module IR to load.GoloCompilationException
- if either of the compilation phase failed.