This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes service locator pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "service locator pattern" Watch "service locator pattern" New topic
Author

service locator pattern

Raj Joe
Ranch Hand

Joined: Oct 15, 2004
Posts: 41
I am caching ejb local objects (stateless session beans)in the service locator in the class level static hashmap variable.

Will there be any impact of this caching in clustered environment?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I guess if you're using only local references, no remote, you weren't getting any benefit from load balancing across the cluster in the first place. Is that right? If so, caching them should do no harm. We used to cache remote (before local existed) and had trouble recovering from stale instances - say the remote server had been stopped and restarted since you got the reference. You might want to try the EJB forum (top of the list!) to get the real EJB experts involved.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: service locator pattern
 
Similar Threads
Service Locator
lets share design pattern questions tips
Caching ejb 3 bean lookups
DTO/TO - Which Tier??
[mock][J2EE pattern][Business Delegate]