• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cache object  RSS feed

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey All!
Can someone tell me how to cache an object?
Thanks in advance,
Trish
 
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
you can use a caching system such as JCS from jakarta.
or you can do it yourself. you probably would need some hasmap structure along with the WeakReferences and ReferenceQueue from java.lang.ref package.
btw: this was just a wild guess....so dont blame me :-)

k
 
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your requirements are very lightweight, the JDK 1.4 LinkedHashMap implements a LRU cache out of the box.
- Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!