• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

RMI basics help!!!

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai,
I am quite new to RMI. Can someone please tell what is local access and what is remote access? When I design an RMI application, it is suited for local access as well, right? Or should I build a class for local access separately?
Thanks
NS
 
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RMI is meant to be used for distributed objects and hence has overheads that do not apply(RMI should not be invoked) when accessing objects locally unless there is a VERY good reason for doing so.
regards
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RMI
may help in determining when to access remotely.
When the client and server are on the same JVM the access is local; when different the access is remote.
Note: The Server of your application can become the client of an object on another JVM and would use remote access to access the object whether on the same or different machine.

Does this help ?
regards
[ July 06, 2003: Message edited by: HS Thomas ]
 
Nandini Sriram
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Thomas. It helped. So when a client wants to access an object on another JVM, it uses remote access even when they are on the same machine, right?
 
HS Thomas
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.
If you were to have more than one JVM running on a machine, chances are you are likely to want to be able to move one of them to another machine later and hence objects should be accessed remotely between JVMs.
--I haven't tried accessing a different JVMs object locally when on the same machine .I'm sure there are ways and means but it would be pretty low-level I imagine..
regards
[ July 06, 2003: Message edited by: HS Thomas ]
 
Nandini Sriram
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have a doubt.

Now my doubt is this - class AB object is a remote object because of the remote interface implementation. Will the object 'a' that is defined inside the class AB also be remotely accessible, or locally accessible?
Thanks
Nandini
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The remote interface RemoteRMI should have a method which returns 'a' and implement in class AB.
The class A should implement Serializable.
When you call the get method for 'a' from client code, a copy of 'a'(by value) will be returned to client.
Hope that clarifies your question.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic