I would like to associate a variable / value with a thread so that I don't have to explicitly pass it down the call stack. It's basically a global variable that is scoped to the current thread.
I have a method that needs to define a variable that will be accessible in the callstack x more methods deep. I don't want to have to pass it all X method layers deep.
Everywhere I search folks give examples using the ThreadLocal class. Maybe I'm missing something, but using ThreadLocal, how do I get a reference to the ThreadLocal variable when I'm X levels deep in a method calls?
All help is appreciated.