Spring Framework NamedInheritableThreadLocal - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework NamedInheritableThreadLocal class.

This code example shows how to use the following methods:
 
	private static final ThreadLocal<LocaleContext> localeContextHolder =
			new NamedThreadLocal<LocaleContext>("Locale context");
 
	private static final ThreadLocal<LocaleContext> inheritableLocaleContextHolder =
			new NamedInheritableThreadLocal<LocaleContext>("Locale context");
 
 
	/** 
	 * Reset the LocaleContext for the current thread. 
	 */ 
	public static void resetLocaleContext() { 
		localeContextHolder.remove();
		inheritableLocaleContextHolder.remove();
	} 
 
	/** 
	 * Associate the given LocaleContext with the current thread, 
	 * <i>not</i> exposing it as inheritable for child threads. 
	 * <p>The given LocaleContext may be a {@link TimeZoneAwareLocaleContext}, 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java