I've a factory who build the DatabaseImpl object. The Factory has a collection of them. If the Server-Client want to stop the server, it calls Naming.unbind and destroys all items of the collection of DatabasImpl objects by the method below. But the client can work further . How can i destroy the DatabaseImpl objects and not only the items in the collection?
database = null doesn't work
Thanks for response
author and jackaroo
Have you considered going about this a totally different way? Instead of trying to stop the client calling a remote method, have your server side methods check if they are supposed to be accepting remote calls. If not, they can either block or throw some exception depending on what you consider to be a good business rule.
When you start to shut down your server, you should probably be locking the database against any write operations - this would be essential before allowing the server to stop (consider what happens if the server stops in the middle of writing a record). Setting some flag to say that remote calls are not being accepted could also be used as a flag to say that writes are no longer allowed.