| Author |
B&S: Problem with stop server
|
Bodenstab Oliver
Ranch Hand
Joined: Mar 03, 2005
Posts: 47
|
|
Hallo, i have a problem with stopping my server. 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 Oliver
|
SCJP
|
 |
Andrew Monkhouse
author and jackaroo
Marshal Commander
Joined: Mar 28, 2003
Posts: 10816
|
|
Hi Oliver, 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. Regards, Andrew
|
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
|
 |
Bodenstab Oliver
Ranch Hand
Joined: Mar 03, 2005
Posts: 47
|
|
Thanks for help. I think i should go this way. Oliver
|
 |
 |
|
|
subject: B&S: Problem with stop server
|
|
|