Class CurrentLocale
java.lang.Object
org.identityconnectors.common.l10n.CurrentLocale
Thread local variable that impacts localization
of all messages in the connector framework. This is
roughly equivalent to .Net's Thread.CurrentCulture. Note
that this is an inheritable thread local so it
is automatically inherited from parent to child thread.
Of course, if the child thread is part of a thread
pool, you will still need to manually propagate
from parent to child.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clears the locale for the current thread.static Locale
get()
Gets the locale from the current thread.static boolean
isSet()
Returns true iff a thread-local locale is specified on the current thread.static void
Sets the locale for the current thread.
-
Constructor Details
-
CurrentLocale
public CurrentLocale()
-
-
Method Details
-
set
Sets the locale for the current thread.- Parameters:
locale
- The locale to use.
-
clear
public static void clear()Clears the locale for the current thread. -
get
Gets the locale from the current thread. ReturnsLocale.getDefault
if no locale is specified.- Returns:
- the locale from the current thread.
-
isSet
public static boolean isSet()Returns true iff a thread-local locale is specified on the current thread.- Returns:
- true iff a thread-local locale is specified on the current thread.
-