org.kuali.rice.core.framework.util
Class ApplicationThreadLocal<T>

java.lang.Object
  extended by java.lang.ThreadLocal<T>
      extended by org.kuali.rice.core.framework.util.ApplicationThreadLocal<T>

public class ApplicationThreadLocal<T>
extends ThreadLocal<T>

ThreadLocal subclass that is capable of clearing instances of itself registered with threads in the VM.


Constructor Summary
ApplicationThreadLocal()
           
 
Method Summary
static boolean clear()
          Remove all ApplicationThreadLocal instances from threads.
protected  boolean remove(Thread t)
          Perform brittle hacks to unset ThreadLocal for a thread.
static boolean removeThreadLocal(Thread thread, ThreadLocal threadLocal)
          Utility method for removing a specific ThreadLocal from a Thread
 
Methods inherited from class java.lang.ThreadLocal
get, initialValue, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationThreadLocal

public ApplicationThreadLocal()
Method Detail

remove

protected boolean remove(Thread t)
Perform brittle hacks to unset ThreadLocal for a thread. NOTE: this method is not threadsafe. the underlying implementation probably reasonably assumes ThreadLocalMap remove is only going to be called from the owning thread. since our explicit purpose is to forcibly yank these thread locals from arbitrary threads, we are breaking this assumption. we're doing the best we can.

Parameters:
t - the thread

removeThreadLocal

public static boolean removeThreadLocal(Thread thread,
                                        ThreadLocal threadLocal)
Utility method for removing a specific ThreadLocal from a Thread

Parameters:
thread - the thread
threadLocal - the threadlocal to remove()
Returns:
true if successful false otherwise

clear

public static boolean clear()
Remove all ApplicationThreadLocal instances from threads.



Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.