• Post Reply Bookmark Topic Watch Topic
  • New Topic

Local - Remote switch  RSS feed

 
Mo Gupta
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • 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
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • 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.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • 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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!