I'm building a singleton that has a ThreadLocal as an instance variable, this singleton has a method that may be accessed by multiple threads and it is lazily instantiated. Right now I'm thinking on something like this:
static final ThreadLocal<HashMap> bindingContext = new ThreadLocal<HashMap>();
But I'm not sure if it is a good idea, I also have the option to make it an instance variable since I'm using it (as I said on a singleton).
So the question is, where is the best place to initialize that class variable or should it be a class variable at all?