jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "service locator pattern" Watch "service locator pattern" New topic

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
It's not a secret anymore!