Package com.openhtmltopdf.util
Class ThreadCtx
- java.lang.Object
-
- com.openhtmltopdf.util.ThreadCtx
-
public class ThreadCtx extends java.lang.Object
Because OpenHTMLtoPDF is designed to run in a single thread at all times for one invocation, we can use a ThreadLocal to store pseudo global variables. This MUST be set up in the appropriate renderer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThreadCtx.ThreadData
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<ThreadCtx.ThreadData>
data
private static java.lang.ThreadLocal<java.util.function.Consumer<Diagnostic>>
diagnosticConsumer
-
Constructor Summary
Constructors Constructor Description ThreadCtx()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
addDiagnostic(Diagnostic diagnostic)
static java.io.Closeable
applyDiagnosticConsumer(java.util.function.Consumer<Diagnostic> consumer)
static void
cleanup()
static ThreadCtx.ThreadData
get()
-
-
-
Field Detail
-
data
private static final java.lang.ThreadLocal<ThreadCtx.ThreadData> data
-
diagnosticConsumer
private static final java.lang.ThreadLocal<java.util.function.Consumer<Diagnostic>> diagnosticConsumer
-
-
Method Detail
-
get
public static ThreadCtx.ThreadData get()
-
addDiagnostic
static void addDiagnostic(Diagnostic diagnostic)
-
cleanup
public static void cleanup()
-
applyDiagnosticConsumer
public static java.io.Closeable applyDiagnosticConsumer(java.util.function.Consumer<Diagnostic> consumer)
-
-