org.allcolor.yahp.converter
Class CThreadContext

java.lang.Object
  extended by org.allcolor.yahp.converter.CThreadContext

public final class CThreadContext
extends java.lang.Object

This class is a context bound to a thread

Version:
0.94
Author:
Quentin Anciaux

Field Summary
private static java.util.Map contextLocal
          A thread context is thread bound
private  CMutex mutex
          mutex for thread safety
private  java.util.Map valueMap
          Contains attributes set in this context
 
Constructor Summary
CThreadContext()
           
 
Method Summary
static void destroy()
           
 java.lang.Object get(java.lang.String key)
          Get the value with the given key from this context
static CThreadContext getInstance()
          Return a thread context
 void set(java.lang.String key, java.lang.Object value)
          Set a value in this context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextLocal

private static final java.util.Map contextLocal
A thread context is thread bound


valueMap

private final java.util.Map valueMap
Contains attributes set in this context


mutex

private final CMutex mutex
mutex for thread safety

Constructor Detail

CThreadContext

public CThreadContext()
Method Detail

getInstance

public static final CThreadContext getInstance()
Return a thread context

Returns:
a thread context

destroy

public static void destroy()

get

public final java.lang.Object get(java.lang.String key)
Get the value with the given key from this context

Parameters:
key - the key to lookup
Returns:
the value with the given key from this context

set

public final void set(java.lang.String key,
                      java.lang.Object value)
Set a value in this context

Parameters:
key - the key to save the value on
value - the value to set