public class BytecodeLoader extends java.lang.Object implements ScriptArchiveCompiler
ScriptArchiveCompiler
that loads java bytecode from .class files in a ScriptArchive
.Constructor and Description |
---|
BytecodeLoader() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Class<?>> |
compile(ScriptArchive archive,
JBossModuleClassLoader moduleClassLoader,
java.nio.file.Path targetDir)
Compile the archive into a ScriptModule
|
boolean |
shouldCompile(ScriptArchive archive)
Compile (load from) an archive, if it contains any .class files.
|
public boolean shouldCompile(ScriptArchive archive)
shouldCompile
in interface ScriptArchiveCompiler
public java.util.Set<java.lang.Class<?>> compile(ScriptArchive archive, JBossModuleClassLoader moduleClassLoader, java.nio.file.Path targetDir) throws ScriptCompilationException, java.io.IOException
ScriptArchiveCompiler
compile
in interface ScriptArchiveCompiler
archive
- archive to generate class files formoduleClassLoader
- class loader which can be used to find all classes and resources for modules.
The resultant classes of the compile operation should be injected into the classloader
for which the given archive has a declared dependency ontargetDir
- a directory in which to store compiled classes, if any.ScriptCompilationException
- if there was a compilation issue in the archive.java.io.IOException
- if there was a problem reading/writing the archive