public class ThreadContext extends Object implements AutoCloseable
try (ThreadContext tc = new ThreadContext(theClassLoader, theMDC)) {
// The code in this scope will use theClassLoader and theMDC.
}
// Out of the scope, the code will use the outer class loader and mdc.
It's only intended to be used in a try-with-resources block, avoid using it in another fashion.| Constructor and Description |
|---|
ThreadContext(ClassLoader classLoader,
Map<String,String> mdc) |
public ThreadContext(ClassLoader classLoader, Map<String,String> mdc)
public void close()
close in interface AutoCloseableCopyright © 2003–2024 MuleSoft, Inc.. All rights reserved.