• Post Reply Bookmark Topic Watch Topic
  • New Topic

service locator pattern  RSS feed

 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the service locator pattern ,we cache the JNDI lookup.What is the best way to cache the lookup?Is hashmap a best option for that?

Thanks
Deepa
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepa,

It depends upon the amount of data you need to cache, but for what you want to achieve is quite good. You could look at the WeakHashMap as well, if you want your collection to implement soft references, or the org.apache.commons.collections.LRUMap.
Regards.
 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tanase.
The application is going to have a 1500 users on an average.
Does caching affect privileges ?
[ July 15, 2005: Message edited by: Deepa Krishnan ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do y'all in real life handle stale information? What if a partner system goes down & comes back up ... your cached values will not work any more, right?
 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have designed in such a way that the cache depends only on the main application.If a supporting system goes down ,it does not bring down this cache and i got the answer for the privileges too.Cache just gives the lookup ,it has nothing to do with privileges.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!