• 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

Local - Remote switch

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I doubt why Sun is reluctant to provide a switch for EJB's that is capable to configure it with Remote object / Local object at runtime ? This is quite possible and has seen no troubles when implemented with vendor specific API's.

Thank you,
Regards,
- Manoj.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the book HF EJB explains, a remote client will always connect to the remote EJB using remote interface, which in turn is impossible to connect to that EJB using local interface.

In addition, if you are a local client, you will usually connect to the EJB using local interface. Although you can use remote interface to connect to local EJB as well, this gives lots of overhead.

In such sense, even the idea is possible, but it may not really that practical.

Nick
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that the local interfaces marshall the parameters by reference, where as the remote interfaces marshall it by value. Which means the semantics of the code will also change accordingly.
So, providing a switch would be error-prone.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by MG:
Hi,

I doubt why Sun is reluctant to provide a switch for EJB's that is capable to configure it with Remote object / Local object at runtime ? This is quite possible and has seen no troubles when implemented with vendor specific API's.

Thank you,
Regards,
- Manoj.




In EJB 2.0 add Local interface because
1. Decrease overhead in network (remote)
2. Local interface seem like normal interface
3. Parameter of method in local interface can pass-by-value
4. More efficiency than Remote Interface

But Local interface can use connect to Bean in same JVM only, can not connect to Bean in another JVM.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MG,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Thanks Pardner! Hope to see you 'round the Ranch!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic