This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes toString and equals as remote methods... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "toString and equals as remote methods... " Watch "toString and equals as remote methods... " New topic
Author

toString and equals as remote methods...

James Turner
Ranch Hand

Joined: May 10, 2004
Posts: 194
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


James<br />SCJP 1.4 - 92%<br />SCJD - 93%<br />SCWCD 1.4 - 95%<br />SCBCD 1.3 - 100%<br />SCEA - 92%
Joakim Eriksson
Greenhorn

Joined: Sep 13, 2004
Posts: 25
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: toString and equals as remote methods...
 
Similar Threads
"toString()" question
toString and equals as remote methods...
check the equality of StringBuffers
Wrapper classe
StringBuffer