• 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

How to create a cache for JNDI calls

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
can some one give me some helps tp create a cache for JNDI lookups.

I have tens of web services in a web application (war) and they all use JNDI lookups widely.

Now i want to create a cache to prevent extra jndi lookups. As they stateless web services then i can not create a chache inside one of them because after each call the cache will be gone.

what i thought is creating a servlet that initiate a cache when application start, but i do not know how i can do it. (in term of writing codes and design pattern)

Can you give me some tips?

Thanks
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raminaa,
Why not just use a singleton class as your cache?
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which application server are you using?

Some actually do this behind the scenes for you.

Have you positively identified this as a bottleneck in your application? If the lookup time is incomparable to the time it takes to interact and use the resource/web service, then optimizing this step is merely an academic exercise, of little value to actual runtime performance.

Just a thought.

-Cameron McKenzie
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about a ServiceLocator
 
reply
    Bookmark Topic Watch Topic
  • New Topic