aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Remote Data (factory or just one instance?) 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 "Remote Data (factory or just one instance?)" Watch "Remote Data (factory or just one instance?)" New topic
Author

Remote Data (factory or just one instance?)

Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
I have a RemoteData object which implents my RemoteDataInterface and extends UnicastRemoteObject (It also has a reference to the db and a reference to my LockManager).
Right now, in my server, I am just making one of these available via RMI to the clients.
Does anyone have an opinion of which would be better... the way I currently have it, or make a factory that is put in the rmi registry, and then make that factory give out new RemoteData objects to clients?
Also, when I just put the one RemoteData in the rmi registry, does that mean that all clients are going through that one object? I am wondering if this will mess up my locking since my LockManager uses a ref to the RemoteData as the client id in my locking hashtable.
Thanks in advance for any advice here.


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>
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

or make a factory that is put in the rmi registry, and then make that factory give out new RemoteData objects to clients?

Yes you must make the factory.
Also, when I just put the one RemoteData in the rmi registry, does that mean that all clients are going through that one object?

Yes.
I am wondering if this will mess up my locking since my LockManager uses a ref to the RemoteData as the client id in my locking hashtable.

Yes it will mess it up.
Hope that helps
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Remote Data (factory or just one instance?)