• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Shutting Down RMI Registry

 
Tony Collins
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For my Contractor project I wish to be able to shut the Server Down, allowing clients no access to remote objects. I need to do this so I can cache a new DB file when the server user requires a different DB file to be used.
So I would require the registry to close (not sure how I do this) and any objects created by my connection factory to be garbage collected. This would ensure no clients with references to remote objects could access the DB after the Server has shut down.
I know evertthing is garbage collected if the Server is exit'ed, but I actually want just the connection to go down while the Server GUI stays up and restarts the Connection Factory.
Has anyone an idea how I do this ?

Tony
 
Tony Collins
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Being more specific I supose my question is how do I delete Objects on the Server that are being referenced remotelly ?
Tony
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tony
You can always unbind your bound objects from the registry, but that won't help with the connections that you already have opened.
If you really wanted to close down existing connections, then I guess you could set up a two way communication between the client and the server. That way the server could send a message stating that the connection is being closed. I think this is probably overkill for this assignment though.
Another alternative might be to have a global variable somewhere indicating that you are in maintenance mode. So if a client with an existing connection called a remote method, it would either block while you are in maintenance mode, or throw an exception.
I would require the registry to close (not sure how I do this)

As far as I know it is not possible to stop the registry programattically.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic