org.identityconnectors.framework.impl.api.local
Class ThreadClassLoaderManager

java.lang.Object
  extended by org.identityconnectors.framework.impl.api.local.ThreadClassLoaderManager

public class ThreadClassLoaderManager
extends Object

Provides a for managing the thread-local class loader


Method Summary
 ClassLoader getCurrentClassLoader()
          Returns the current thread-local class loader
static ThreadClassLoaderManager getInstance()
          Returns the thread-local instance of the manager
 List<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ThreadClassLoaderManager getInstance()
Returns the thread-local instance of the manager

Returns:

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


Copyright © 2011. All Rights Reserved.