diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-10-30 21:51:28 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-10-30 21:51:28 +0000 |
commit | 6299c6128ba93a33ae2b91f7c48f0d97a41dfef9 (patch) | |
tree | 921348d49cdbd373a32297d02c4b552fda204d4d /java/src/IceBox/ServiceManagerI.java | |
parent | Wait for the service communicator to be shutdown before to close the (diff) | |
download | ice-6299c6128ba93a33ae2b91f7c48f0d97a41dfef9.tar.bz2 ice-6299c6128ba93a33ae2b91f7c48f0d97a41dfef9.tar.xz ice-6299c6128ba93a33ae2b91f7c48f0d97a41dfef9.zip |
Wait for the service communicator to be shutdown before to close the
service database environment.
Diffstat (limited to 'java/src/IceBox/ServiceManagerI.java')
-rw-r--r-- | java/src/IceBox/ServiceManagerI.java | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/java/src/IceBox/ServiceManagerI.java b/java/src/IceBox/ServiceManagerI.java index f36ae356634..8261e4511b7 100644 --- a/java/src/IceBox/ServiceManagerI.java +++ b/java/src/IceBox/ServiceManagerI.java @@ -332,10 +332,18 @@ public final class ServiceManagerI extends _ServiceManagerDisp ServiceInfo info = (ServiceInfo)_services.remove(service); assert(info != null); + FailureException failureEx = null; + try { info.service.stop(); + if(info.communicator != null) + { + info.communicator.shutdown(); + info.communicator.waitForShutdown(); + } + if(info.dbEnv != null) { info.dbEnv.close(); @@ -343,39 +351,15 @@ public final class ServiceManagerI extends _ServiceManagerDisp } catch(Freeze.DBException ex) { - if(info.communicator != null) - { - try - { - info.communicator.destroy(); - } - catch(Exception e) - { - } - } - - FailureException e = new FailureException(); - e.reason = "ServiceManager: database exception in stop for service " + service + ": " + ex; - e.initCause(ex); - throw e; + failureEx = new FailureException(); + failureEx.reason = "ServiceManager: database exception in stop for service " + service + ": " + ex; + failureEx.initCause(ex); } catch(Exception ex) { - if(info.communicator != null) - { - try - { - info.communicator.destroy(); - } - catch(Exception e) - { - } - } - - FailureException e = new FailureException(); - e.reason = "ServiceManager: exception in stop for service " + service + ": " + ex; - e.initCause(ex); - throw e; + failureEx = new FailureException(); + failureEx.reason = "ServiceManager: exception in stop for service " + service + ": " + ex; + failureEx.initCause(ex); } if(info.communicator != null) @@ -386,12 +370,16 @@ public final class ServiceManagerI extends _ServiceManagerDisp } catch(Exception ex) { - FailureException e = new FailureException(); - e.reason = "ServiceManager: exception in stop for service " + service + ": " + ex; - e.initCause(ex); - throw e; + failureEx = new FailureException(); + failureEx.reason = "ServiceManager: exception in stop for service " + service + ": " + ex; + failureEx.initCause(ex); } } + + if(failureEx != null) + { + throw failureEx; + } } private void |