• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Business Delegate and dependency Injection

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all...
I�ve seen some previous post about the use of dependency injection in managed beans (jsf, servlets) to get reference to a Session Facade Bean.

After reading all, I think that the consensus when using JEE5, you should use "Dependency Injection". But then, I have a doubt, I understand that the reference to the EJB (using DI) is not really the EJB, but a component provided by the container that makes the same work (Business Delegate and Service Locator pattern). Now, if I don't use a BD built by myself, where should I manage my Network, Remote exceptions? Is it a good practice to make it on my managed bean? Does this question goes to just have a better exception management?

Greetins,

Ra�l
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AFAIK, DI will only work for "local" EJBs so it might not be the best solution for obtaining reference to EJBs from your Web tier.

But, DI will be useful for setting the EntityManager and other resources managed by the container to your EJBs.

HTH.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DI applies to both Local and remote business interface/reference.

DI is invoked during init phase, before any business methods, if exception occurs, EJB instance is destroyed.

Under EJB 3 context, the most likely system exception you will get is "EJBException" (not remote exception)

Cheers,
Tao
 
reply
    Bookmark Topic Watch Topic
  • New Topic