• 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

Interfaces

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, ¿could someone explain what way the next code works?


InterfaceName bean =(InterfaceName)context.lookup("JNDI-Name");


In bean, ¿is loaded an interface name or the code which is write in the EJB which correspond the interface name, or another way?

Thanks.
 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The resource at "JNDI-NAME" is fetched from the JNDI and returned as an Object.
It is not an interface it is an Object.

The next step is to cast the resulted Object to the type you're expecting (in this case "InterfaceName").

Does this answer your question?
 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The resource at "JNDI-NAME" is fetched from the JNDI and returned as an Object.
It is not an interface it is an Object.

The next step is to cast the resulted Object to the type you're expecting (in this case "InterfaceName").

Does this answer your question?


Yes , thanks for your answer.
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's great :-)

Good luck!
 
reply
    Bookmark Topic Watch Topic
  • New Topic