Package com.openhtmltopdf.util
Class ThreadCtx
java.lang.Object
com.openhtmltopdf.util.ThreadCtx
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal
<ThreadCtx.ThreadData> private static final ThreadLocal
<Consumer<Diagnostic>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
addDiagnostic
(Diagnostic diagnostic) static Closeable
applyDiagnosticConsumer
(Consumer<Diagnostic> consumer) static void
cleanup()
static ThreadCtx.ThreadData
get()
-
Field Details
-
data
-
diagnosticConsumer
-
-
Constructor Details
-
ThreadCtx
public ThreadCtx()
-
-
Method Details
-
get
-
addDiagnostic
-
cleanup
public static void cleanup() -
applyDiagnosticConsumer
-