Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need for Service Locator  RSS feed

 
Antonio Fornie
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

My question is: for JEE5 (SCEA5), do we still need to use Service Locator as we used to (prior to EJB 3.0)? When accessing a Statelss EJB, why should we use a Service Locator if we can just inject it through annotations?

On the other hand, when it comes to accessing Stateful EJB (from a Stateless EJB or any non-stateful object) we can't just inject it since we would keep injected the same Stateful Bean for the other users, so what to do there? Do we use a Service Locator there?

Thank you very much. Bye

antonio
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37242
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Antonio,
You are correct. In the first case, you don't use a service locator and in the second you do.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!