public class NarCloseable extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
logger |
private ClassLoader |
toSet |
| Modifier | Constructor and Description |
|---|---|
private |
NarCloseable(ClassLoader toSet) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static NarCloseable |
withComponentNarLoader(ClassLoader componentNarLoader)
Sets the current thread context class loader to the provided class loader, and returns a NarCloseable that will
return the current thread context class loader to it's previous state.
|
static NarCloseable |
withComponentNarLoader(ExtensionManager extensionManager,
Class componentClass,
String componentIdentifier)
Sets the current thread context class loader to the specific appropriate class loader for the given
component.
|
static NarCloseable |
withFrameworkNar()
Creates a Closeable object that can be used to to switch to current class
loader to the framework class loader and will automatically set the
ClassLoader back to the previous class loader when closed
|
static NarCloseable |
withNarLoader() |
private static final org.slf4j.Logger logger
private final ClassLoader toSet
private NarCloseable(ClassLoader toSet)
public static NarCloseable withNarLoader()
public static NarCloseable withComponentNarLoader(ExtensionManager extensionManager, Class componentClass, String componentIdentifier)
componentClass - the component classcomponentIdentifier - the identifier of the componentpublic static NarCloseable withComponentNarLoader(ClassLoader componentNarLoader)
componentNarLoader - the class loader to set as the current thread context class loaderpublic static NarCloseable withFrameworkNar()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2023 Apache NiFi Project. All rights reserved.