Package net.openhft.compiler
Class CachedCompiler
java.lang.Object
net.openhft.compiler.CachedCompiler
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable File
private static final PrintWriter
private final Map
<ClassLoader, MyJavaFileManager> private final ConcurrentMap
<String, JavaFileObject> private final Map
<ClassLoader, Map<String, Class<?>>> private static final org.slf4j.Logger
private final @Nullable File
-
Constructor Summary
ConstructorsConstructorDescriptionCachedCompiler
(@Nullable File sourceDir, @Nullable File classDir) CachedCompiler
(@Nullable File sourceDir, @Nullable File classDir, @NotNull List<String> options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
compileFromJava
(@NotNull String className, @NotNull String javaCode, @NotNull PrintWriter writer, MyJavaFileManager fileManager) compileFromJava
(@NotNull String className, @NotNull String javaCode, MyJavaFileManager fileManager) loadFromJava
(@NotNull ClassLoader classLoader, @NotNull String className, @NotNull String javaCode) loadFromJava
(@NotNull ClassLoader classLoader, @NotNull String className, @NotNull String javaCode, @Nullable PrintWriter writer) loadFromJava
(@NotNull String className, @NotNull String javaCode)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
DEFAULT_WRITER
-
DEFAULT_OPTIONS
-
loadedClassesMap
-
fileManagerMap
-
sourceDir
-
classDir
-
options
-
javaFileObjects
-
-
Constructor Details
-
CachedCompiler
-
CachedCompiler
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
loadFromJava
public Class loadFromJava(@NotNull @NotNull String className, @NotNull @NotNull String javaCode) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
loadFromJava
public Class loadFromJava(@NotNull @NotNull ClassLoader classLoader, @NotNull @NotNull String className, @NotNull @NotNull String javaCode) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
compileFromJava
@NotNull @NotNull Map<String,byte[]> compileFromJava(@NotNull @NotNull String className, @NotNull @NotNull String javaCode, MyJavaFileManager fileManager) -
compileFromJava
@NotNull @NotNull Map<String,byte[]> compileFromJava(@NotNull @NotNull String className, @NotNull @NotNull String javaCode, @NotNull @NotNull PrintWriter writer, MyJavaFileManager fileManager) -
loadFromJava
public Class loadFromJava(@NotNull @NotNull ClassLoader classLoader, @NotNull @NotNull String className, @NotNull @NotNull String javaCode, @Nullable @Nullable PrintWriter writer) throws ClassNotFoundException - Throws:
ClassNotFoundException
-