edu.internet2.middleware.grouper.ui
Class UIThreadLocal

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.UIThreadLocal

public class UIThreadLocal
extends Object

Convenience class which allows disparate parts of code keep track of goings on within a thread

Version:
$Id: UIThreadLocal.java,v 1.6 2008/04/04 13:53:13 isgwb Exp $
Author:
Gary Brown.

Constructor Summary
UIThreadLocal()
           
 
Method Summary
static void clear()
          Resets any values - use at beginning of Thread use e.g.
static Object get(String key)
          Retrieve object previously saved
static Object get(String key, String key1)
          Retrieve nested value from Map defined by key
static boolean isDebug()
           
static void put(String key, Object value)
          Stores a value.
static void put(String key, String key1, Object value)
          If value indicated by key is itself a Map, put(key1,value) If no value create a new HashMap first
static void replace(String key, Object value)
          Replaces any current value for the key with the new value - regardless of type.
static void setDebug(boolean debug)
          Set debug mode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIThreadLocal

public UIThreadLocal()
Method Detail

clear

public static void clear()
Resets any values - use at beginning of Thread use e.g. Filter in servlet engine


put

public static void put(String key,
                       Object value)
Stores a value. If there is an existing value for the key which is a List, then it appends the value to that List

Parameters:
key - to set
value - for key

replace

public static void replace(String key,
                           Object value)
Replaces any current value for the key with the new value - regardless of type. Use instead of put when appending to existing List should not hapen

Parameters:
key - to set
value - for key

put

public static void put(String key,
                       String key1,
                       Object value)
If value indicated by key is itself a Map, put(key1,value) If no value create a new HashMap first

Parameters:
key - for nested Map
key1 - to set
value - for key1

get

public static Object get(String key)
Retrieve object previously saved

Parameters:
key - to retrieve
Returns:
Object previously set

get

public static Object get(String key,
                         String key1)
Retrieve nested value from Map defined by key

Parameters:
key - for nested Map
key1 - for value to retrieve
Returns:
value for key1

setDebug

public static void setDebug(boolean debug)
Set debug mode

Parameters:
debug -

isDebug

public static boolean isDebug()
Returns:
true if debug mode is on