Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

service locator pattern

 
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
 
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 ]
 
(instanceof Sidekick)
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.
 
The knights of nee want a shrubbery. And a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic