• 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

EJB 2.0 - Local - Remote

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
1.I would like to know the difference between RemoteInterface, RemoteHomeInterface and LocalInterface and LocalHomeInterface.
2. Is it true that a Servlet can access a RemoteInterface but not a RemoteHomeInterface on the same machine.
Thanks
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The EJB interfaces are split into "home" and "remote". The home interface deals with creating and destroying the bean. The remote interface has all the business methods in it. Typically you retrieve a home interface, for example from JNDI, and you it to create the remote interface.
The difference between local and remote arose later. The problem is that clients and beans communicate via network protocols. If the client is, for example, another bean, it could be running in the same JVM so commuincating via the network is a huge waste of time. The local home and local interfaces parallel the home and remote interfaces. Usually, they have exactly the same methods.
As I said before, you use the home interface to retrieve the remote interface, so it makes no sense that a servlet would be able to access the remote without also being able to access the home. However, a servlet might not be able to access the local interfaces, because it would use a different class loader from the beans. That depends on the app server.
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic