• Post Reply Bookmark Topic Watch Topic
  • New Topic

Remote object life time?  RSS feed

J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, please help me in my understanding....
(assume Unicastremoteobject)
I have an RMI server that creates an instance of object X and then registers X with the registry.
Client A binds to this object X
Client B binds(rebinds?) to this object X
Both clients are very happy and call methods of object X
The server is still running(how? its went out of its main() didnt it???) .if the server dies so does the object instance X right?
Both clients exit. And implicity no longer reference the instance.
Now, the big question!, because no clients reference X, does it get garbage collected???. if not, does this this mean that if the server that created X is running than it will not get garbage collected.
if it does get garbage collected, what if client C come along and class bind ro rebind?...well x doesnt exist!, what happens then?
All help much appreciated!!!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!