public static final CThreadContext getInstance ( ) { SoftReference ref = ( SoftReference ) CThreadContext . contextLocal . get ( Thread . currentThread ( ) ) ; CThreadContext context = null ; if ( ( ref == null ) || ( ref . get ( ) == null ) ) { context = new CThreadContext ( ) ; ref = new SoftReference ( context ) ; CThreadContext . contextLocal . put ( Thread . currentThread ( ) , ref ) ; } else { context = ( CThreadContext ) ref . get ( ) ; } return context ; }
Return a thread context