File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question about RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question about RMI" Watch "Question about RMI" New topic
Author

Question about RMI

Sam Stackly
Ranch Hand

Joined: May 04, 2002
Posts: 109
Hi Guys,
Just have a quick question about RMI, that is : does each request from client get an instance of remote object in server or all client talk to one instance?
Thanks in advance
Sam
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
Originally posted by Sam Stackly:
Hi Guys,
Just have a quick question about RMI, that is : does each request from client get an instance of remote object in server or all client talk to one instance?
Thanks in advance
Sam


I have each client getting its own instance. That way I can use that client as the id for my locking.


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Sam Stackly
Ranch Hand

Joined: May 04, 2002
Posts: 109
so you generate an instance for each client, how about RMI? what's RMI doing if you don't do that, I mean what's the nature of RMI? single instance and pass that instance to all request or RMI create an instance of remote object per request?
Thanks
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
Originally posted by Sam Stackly:
so you generate an instance for each client, how about RMI? what's RMI doing if you don't do that, I mean what's the nature of RMI? single instance and pass that instance to all request or RMI create an instance of remote object per request?
Thanks

I guess I wasn't too clear. I have one instance of a remote data factory that I bind for rmi. That factory will then give out remote data objects, one per client, that I use to get my remote data and that my LockManager uses as the clientId for locking/unlocking records.
Hope that helps.
Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Nate
This means that in your design, the lock() and unlock() methods at Data are empty and all locking is perfomred by the LockManager.
What did u right for javadoc of lock and unlock in Data. How did you defend it in your design choice

Amit
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
Originally posted by Amit Kr Kumar:
Hi Nate
This means that in your design, the lock() and unlock() methods at Data are empty and all locking is perfomred by the LockManager.
What did u right for javadoc of lock and unlock in Data. How did you defend it in your design choice

Amit


Yeah they are empty in my data class. Haven't written my doc yet thought, sorry.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about RMI