Provides a context for localized parameters, mainly formatters, in thread local scope.
Note normally the Formatting classes are not thread safe.
This class uses ThreadLocal to return a unique object to each thread, so the getFloatingPointFormatter
returns the same object in one thread, and getIntegerFormatter returns another one in the same thread.
By using only LocaleContext to get Format objects instead of constructing Format objects
otherwise, thread-safety is ensured. This class is tuned for performance: constructing a Format
object is rather expensive, this class only creates them when really needed.
Reset thread local variables. For example this can be called when an application is 'undeployed'.
This was done to fix a memory leak in tomcat that happened when the app context was destroyed.
The context couldn't be properly destroyed as objects were still in the threadlocal map.