org.kuali.rice.core.util
Class ContextClassLoaderBinder

java.lang.Object
  extended by org.kuali.rice.core.util.ContextClassLoaderBinder

public final class ContextClassLoaderBinder
extends Object

Utility class that binds/unbinds the context ClassLoader of the current Thread using a ThreadLocal. This class supports re-entrancy by maintaining a stack of context classloaders. NOTE: maybe implement stricter checks, by matching some contextual object or original classloader on bind to the unbind so that they are always matched (within a given context)

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
private static org.apache.log4j.Logger LOG
           
private static ThreadLocal<List<ClassLoader>> STACK
          Stack of previous context classloaders that should be restored on unbind
 
Constructor Summary
ContextClassLoaderBinder()
           
 
Method Summary
static void bind(ClassLoader cl)
           
private static List<ClassLoader> getStack()
           
static void unbind()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

STACK

private static final ThreadLocal<List<ClassLoader>> STACK
Stack of previous context classloaders that should be restored on unbind

Constructor Detail

ContextClassLoaderBinder

public ContextClassLoaderBinder()
Method Detail

getStack

private static List<ClassLoader> getStack()

bind

public static void bind(ClassLoader cl)

unbind

public static void unbind()


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.