Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

a question about service locator

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
while I were stydying the service locator pattern, I encountered the following methd :

what this method do ?
when we want to use the service locator pattern , we write some thing like:
BeanHome = (BeanHome).ServiceLocator.getInstance( ).getHome("..", BeanHome.class);
and there is also method called :
protected String getId(EJBObject) throws ...
also, what this method do ?
(I am novice at patterns, ok).
thanks.
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Please refer the following URL. http://javaoneonline.mentorware.net/mw/subsystems/2000/system/docs/J2EEBestPractices_webinar.pdf

This will give u a clear idea about Service Locators.

Regards,
Saj
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Service Locator pattern basically used improving the application performance by minimising the number for JNDI lookup calls. From a servlet if you are calling n number of EJB's in the same EJB container, you have to do the n-number of JNDI lookups. To avoid that we are providing a wrapper(as Service Locator) to lookup up the jndi.

Regards,
M.S.Raman
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
actually I know the service locator pattern, but I don't understand the the getService( ) method.
reply
    Bookmark Topic Watch Topic
  • New Topic