• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need for Service Locator

 
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: 35977
422
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!