• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

How does context.lookup work ?

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using following tutorial to learn ejb3 ,

http://www.laliluna.de/download/first-ejb3-tutorial-en.pdf

In this tutorial the the remote interface for a session bean is BookTestBeanRemote and implementing class name
is BookTestBean. This class has a variable

public static final String RemoteJNDIName = BookTestBean.class.getSimpleName() + "/remote";

The client program look for this name in context.lookup i.e

BookTestBeanRemote beanRemote = (BookTestBeanRemote) context.lookup(BookTestBean.RemoteJNDIName);

I am confused as in JNDI namespace the bean is registered as BookTestBean ,so why author has added /remote in front of
bean name to create the RemoteJNDIName?
How and why the server is able to find the ejb BookTestBean/remote whereas the bean is registered as BookTestBean.

Thanks.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remote and Local automatically gets alligned to <Bean-Name>Remote and <Bean-Name>Local JNDI
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic