• Post Reply Bookmark Topic Watch Topic
  • New Topic

Service Locator question

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Sun defines the Service Locator Pattern saying that it "centralizes distributed service object lookups, provides a centralized point of control, and may act as a cache that eliminates redundant lookups."

If we have a singleton Service Locator, and the lookups are cached, won't we be accessing the same stateless session bean instances again and again which were cached? What about the stateless sessiion bean pool? Seems we won't be using it.

Thanks in advance.

-Saha
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Service Locator you don't cache the bean object itself but the Home interface. Remember you access the underyling beans (Entity/Session) through Home interface lookup.
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Purushothaman!

-Saha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!