Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

singletone ServiceLocator

 
Gytis Jakutonis
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm using ServiceLocator pattern to locate EJB's and other JNDI resources. Currently I have singletone ServiceLocator, but I'm not sure about this implementation style. I really hate singletones, because they can not be subclassed, garbaged, initialized in custom way etc. But I can not figure out any alternative way to use ServiceLocator in EJB layer and BusinessDelegate layer. These layers has no access to general scope (like ServletContext). Any ideas?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic