Class ThreadClassLoaderManager
- java.lang.Object
-
- org.identityconnectors.framework.impl.api.local.ThreadClassLoaderManager
-
public final class ThreadClassLoaderManager extends Object
Provides a for managing the thread-local class loader
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearInstance()
Clear the thread-local instance of the manager.ClassLoader
getCurrentClassLoader()
Returns the current thread-local class loaderstatic ThreadClassLoaderManager
getInstance()
Returns the thread-local instance of the managerList<ClassLoader>
popAll()
Hack for OIM.void
popClassLoader()
Restores the previous loader as the thread-local classloader.void
pushAll(List<ClassLoader> loaders)
Hack for OIM.void
pushClassLoader(ClassLoader loader)
Sets the given loader as the thread-local classloader.
-
-
-
Method Detail
-
getInstance
public static ThreadClassLoaderManager getInstance()
Returns the thread-local instance of the manager- Returns:
- the thread-local instance of the manager
-
clearInstance
public static void clearInstance()
Clear the thread-local instance of the manager.
-
pushClassLoader
public void pushClassLoader(ClassLoader loader)
Sets the given loader as the thread-local classloader.- Parameters:
loader
- The class loader. May be null.
-
popClassLoader
public void popClassLoader()
Restores the previous loader as the thread-local classloader.
-
popAll
public List<ClassLoader> popAll()
Hack for OIM. See BundleClassLoader. Pops and returns all class loaders previously pushed, therefore effectively setting the thread's current context class loader to the initial class loader.
-
pushAll
public void pushAll(List<ClassLoader> loaders)
Hack for OIM. See BundleClassLoader. Pushes all class loaders in the list as the context class loader.- Parameters:
loaders
- the loaders to push; never null.
-
getCurrentClassLoader
public ClassLoader getCurrentClassLoader()
Returns the current thread-local class loader- Returns:
- the current thread-local class loader
-
-