• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Local and Remote homes

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am a bit lost here. "You can have both a Remote and local client view for a bean". To get a reference to a home clients does something like and than has to either narrow-cast or cast to EJBHome or EJBLocalHome. How does container know what type of home the client needs?
Thanks
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container doesn't know, but the client *does* know if it is a local or remote client. You would have the local home bound to one JNDI name, and the remote client bound to another name. The client then uses the JNDI name that will get it an appropriate home.
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of other things to keep in mind:
- You don't generally access local interfaces via JNDI in the way you've shown. You usually get them via the environment naming context (what HFE calls 'the bean's special JNDI context'.
- You can cast a local interface via a simple Java cast. Remote interfaces obtained via JNDI or from a handle need to be narrowed, i.e. PortableRemoteObject.narrow(...).
 
reply
    Bookmark Topic Watch Topic
  • New Topic