Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do Session, Request, Application-like with Threads/ThreadLocal Storage?  RSS feed

 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create an application that can save information similarly to a web app's Session, Request and Application objects. I have read that this can be done using ThreadLocal variables. Can anyone show me a quick bit of code to do this? All I'm looking for is a "main" app that runs by kicking off some threads that can show this being done, it does not have to do anymore than allow me to save/read info from the diff. threads.
I also read that this could be done with Class Loaders. Anyone know which is a better idea, and why? And can anyone show me some sample code of doing it with a ClassLoader loading hierarchy?
Thanks!
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any articles. ideas or whatever you can point me to would be a HUGE help! Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!