• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

The only time a lookup is needed

 
Ranch Hand
Posts: 1743
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Frits' notes, p.63,


7.1 @EJB - injecting an EJB
The only time a lookup is needed is when the @EJB and @Resource is declared on the bean class.



I believe a lookup is also needed when an EJB is injected, like this example on p.66:

 
Creator of Enthuware JWS+ V6
Posts: 3290
296
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I meant by that remark is that the lookup is not needed in line number 9.

The following code would be sufficient:

Although the code above doesn't look like it has a lookup of the EJB it certainly does a lookup because "Each injection of an object corresponds to a JNDI lookup" (page 63)

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!