• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

@EJBs annotation.

 
Ranch Hand
Posts: 109
Netbeans IDE Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Do someone knows, how to use @EJBs annotation?
 
Ranch Hand
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Udara,

You must've realized that this annotation takes in its attribute value an array of @EJB, this is used to annotate a bean that somehow refers these @EJB. In other words, doing this the EJB's will be available in the JNDI ENC of the actual EJB, the you'll be able to lookup them through the EJBContext.lookup(...) using a relative path.

I can't also really understand the reason to it, once you could annotate a given interface inside the bean and already inject the desired EJB. Besides the possibility to lookup the bean programmatically (that's also possible after inject directly, but in this case you've already injected one instance of the given EJB), I don't see any good reason to create a reference in the JNDI ENC through annotations to lookup it using InitialContext, EJBContext, etc .. I thought the desired behavior was the opposite.

Maybe there are some obscure reason that we're not seeing that justify the use of it, if you discover, let me know please!

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jayr for your comment.
And

Jayr Motta wrote:Maybe there are some obscure reason that we're not seeing that justify the use of it, if you discover, let me know please!


I will definitely inform you, if I discover.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic