This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Local Client

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know a remote client can't use a local interface but
Can a local client use a remote interface?
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I know a remote client can't use a local interface but
Can a local client use a remote interface?



Well, just the term remote can be confusing.

It'd perhaps be easier if you keep in mind the term component interface. Every session or entity bean must have two interfaces: home interface and component interface.

Local clients "use" local home interface and local component interface. Remote clients "use" remote home interface and remote component interface.

You know that component interface is for remote client when you see that it implements EJBObject as against the component interface for local client, which will implement EJBLocalObject. LIkewise, the home interface for remote client must implement EJBLocalHome and the home interface for local client must implement EJBLocalHome.
Then there's the RemoteException which makes it obvious too.

Does this answer your query, Kris?

Regards,
Saket
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess this should help you kris,

You can surely use remote interface through local client. That is what everyone was doing in previous versions of EJB.

The problem was, even if my client (Mostly servlets) are sitting on same machine and same appserver/webserver combination, One was required to make remote calls through RMI.

What EJB 2.0 provided was Local interfaces for EJBHome and EJBObject and provided normal java object references so as to bypass "not so required" RMI calls.

On the other hand, if you are a remote client, then you surely cant call Beans marked local. The simple reason is, you will never get the stub from that bean. To be more presise you will not get the Home itself to create the bean.

so the concept goes like

Client Location----------------Remote aware Bean-------------Local Bean
Local (Same JRE)---------------Can be accessed-------------Can be accessed.
Remote (Diff. JRE/Machine)-----Can be accessed---------------Not possible

Happy learning
[ April 07, 2005: Message edited by: Chetan Sahasrabudhe ]
 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys

Crystal Clear!!
 
That feels good. Thanks. Here's a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic