ThreadMap

From GreenVulcano Wiki
Jump to: navigation, search

Class FQN: it.greenvulcano.util.thread.ThreadMap This class contains static utility methods to attach/detach objects to current Thread context.

ThreadMap public static methods

/**
 * Retrieve the object associated to 'key' in the current Thread map
 *
 * @param key
 *        the key to search for
 * @return the found object, or null
 */
public static Object get(Object key)

/**
 * Retrieve the objects associated to 'key' in all Thread maps
 *
 * @param key
 *        the key to search for
 * @return the found objects, or an empty array
 */
public static Object[] allThreadGet(Object key)

/**
 * Insert the object 'value' associated to 'key' in the current Thread map
 *
 * @param key
 *        the key to use for mapping
 * @param value
 *        the value to insert
 */
public static void put(Object key, Object value)

/**
 * Insert the object 'value' associated to 'key' in all Thread maps
 *
 * @param key
 *        the key to use for mapping
 * @param value
 *        the value to insert
 */
public static void allThreadPut(Object key, Object value)

/**
 * Remove the object associated to 'key' in the current Thread map
 *
 * @param key
 *        the key to search for
 * @return the found object, or null
 */
public static Object remove(Object key)

/**
 * Remove the objects associated to 'key' in all Thread maps
 *
 * @param key
 *        the key to search for
 */
public static void allThreadRemove(Object key)


ThreadMap RESERVED public static methods

The following methods MUST be used only in Core development.
Using them with caution.

/**
 * Clean the current Thread map
 */
public static void clean()

/**
 * Clean all Thread maps
 */
public static void cleanAll()