public final class ContextHandler
extends java.lang.Object
ContextHandler provides methods for accessing and manipulating the context from
instrumented bytecode.
ContextHandler avoids tight coupling with the concrete implementation of the
context by accessing and manipulating the context through the ContextProvider interface.
Both ContextHandler and ContextProvider are loaded by the bootstrap
classloader so that they can be used from classes loaded by the bootstrap classloader. A concrete
implementation of ContextProvider will be loaded by the system classloader. This allows
for using the same context implementation as the instrumented application.
ContextHandler is implemented as a static class to allow for easy and fast use from
instrumented bytecode. We cannot use dependency injection for the instrumented bytecode.
| Modifier and Type | Method and Description |
|---|---|
static void |
setContextProvider(ContextProvider contextProvider) |
static <A> java.util.concurrent.Callable |
wrapInContextAware(java.util.concurrent.Callable<A> callable) |
static java.lang.Runnable |
wrapInContextAware(java.lang.Runnable runnable) |
public static void setContextProvider(ContextProvider contextProvider)
public static java.lang.Runnable wrapInContextAware(java.lang.Runnable runnable)
public static <A> java.util.concurrent.Callable wrapInContextAware(java.util.concurrent.Callable<A> callable)