The try...finally block ensures that the restore is done even if doSomeOperation terminates abnormally (with an exception).
A thread can consult its own context using ThreadContext.get(myKey). The result is the value that was most recently pushed with the given key.
A thread cannot read or modify the context of another thread.
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |