• 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

@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.
 
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic