• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

service locator pattern

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic