Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

Archive for June 3rd, 2010

Thread Local

Posted by Pankil Patel on June 3, 2010

How to set & get value in thread specific local?

Step 1:

Create a class like bellow:

Step 2:

Set thread specific value in that.

Like: ABCThreadLocal.set(10);

Step 3:

Get that value in any time during that thread.

Like: ABCThreadLocal.get();

Hureeeeeeeeeeee Ready to use Your Thread Local which persist Object’s ( Integer in this case ) value during the thread execution.

Posted in Core Java | Leave a Comment »