Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interfaces

 
Dura Hurtado
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Piotr Nowicki
Ranch Hand
Posts: 610
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: 610
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's great :-)

Good luck!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic