File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

toString and equals as remote methods...

 
James Turner
Ranch Hand
Posts: 194
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how it is possible to make a call to toString and equals and have them be from the Remote Object and not it's stub?

Any help is greatly appreciated.

Thanx..
James
 
Joakim Eriksson
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
usually you have one remote rmi server.
It serves objects from the remote databse.
Once recieved these objects have no connection to the remote data.

Another way is to have the rmi server serve you objects that are still
connected to the remote data. This is done via a "Factory".
In effect every object you recieve from the factory is bound in the registry and is in itself a rmi server.
A "toString()" from this object would then reflect the data currently on the server and not only local changes. changes to this object would also change the remote objects state.

If you track references handed out to the objects and also "return them" by some method before disposing them, they could also be unbound when they are not referenced any more.
It is described in detail in [W.Grosso,"Java RMI", O'Reilley, 2002, pp.377-382]

Hope it helps

/J
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic