Module org.elasticsearch.xcore
Class RestorableContextClassLoader
java.lang.Object
org.elasticsearch.xpack.core.security.support.RestorableContextClassLoader
- All Implemented Interfaces:
AutoCloseable
A try-with-resource compatible object for configuring a thread
Thread.getContextClassLoader().
On construction this class will set the current (or provided) thread's context class loader.
On close(), it restores the previous value of the class loader.-
Constructor Summary
ConstructorsConstructorDescriptionRestorableContextClassLoader(Class<?> fromClass) RestorableContextClassLoader(Thread thread, ClassLoader setClassLoader) -
Method Summary
-
Constructor Details
-
RestorableContextClassLoader
-
RestorableContextClassLoader
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-