• 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

Arguments and Return Types

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ranchers,

Consider this situation.

Say suppose I deploy a bean with Remote Home and Component Interface.

Suppose I have a client running in the same JVM which have a reference to this bean (a reference to the Bean's Remote Interface). Now are the parameters and return values passed by "Copy of Reference" or "Copy of Value"

Cheers,
Sandeep
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ideally it should be copy of value.
But some server's do an optimization like if the call is from one remote bean to another remote bean and both beans are in the same JVM, hte container will automatically convert the remote call to a local call ( and passes argument as copy of reference). may some experts here can throw more lights on it.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sandeep,
The return type, if you are returning a Remote Interface from a method call, that would be a Pass by Value and that would be a stub and Container will take care of serializing it.


Thanks,
Ugender
 
Sandeep Prabhakar
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Folks,

The return value need not be a Remote Interface. It would be anything that is RMI-IIOP Compatible.
Anish, If the Container optimizes and passes a "Copy of Reference" than I feel that it would hurt the portability of Beans.
The bean developer may be tempted to depend on the side effects caused by passing the reference.
Please let me know if I am missing something here.

Cheers,
Sandeep
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Based on what I've read in HF EJB, Local Home and Component pass by reference and have to be in the same JVM. Remote Home and Component pass by value even if they are on the same machine as the bean object. Hope this helps.
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic