summaryrefslogtreecommitdiff
path: root/cs/src/Ice/ObjectAdapterFactory.cs
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-01-05 18:44:54 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-01-05 18:44:54 +0000
commitf6e5f4fa31eb7ca5ae0c6301b579da2752606950 (patch)
tree6198903725faacfb92fa6758a3b65a9812ff41ab /cs/src/Ice/ObjectAdapterFactory.cs
parentfix header file symlink target location for db45 (diff)
downloadice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.tar.bz2
ice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.tar.xz
ice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.zip
Added ObjectAdapter::destroy
Diffstat (limited to 'cs/src/Ice/ObjectAdapterFactory.cs')
-rwxr-xr-xcs/src/Ice/ObjectAdapterFactory.cs36
1 files changed, 27 insertions, 9 deletions
diff --git a/cs/src/Ice/ObjectAdapterFactory.cs b/cs/src/Ice/ObjectAdapterFactory.cs
index b62f73e40a2..2f561decbc4 100755
--- a/cs/src/Ice/ObjectAdapterFactory.cs
+++ b/cs/src/Ice/ObjectAdapterFactory.cs
@@ -81,14 +81,6 @@ namespace IceInternal
{
adapter.waitForDeactivate();
}
-
- //
- // We're done, now we can throw away the object adapters.
- //
- // We set _adapters to null because our destructor must not
- // invoke methods on member objects.
- //
- _adapters = null;
}
lock(this)
@@ -100,6 +92,32 @@ namespace IceInternal
System.Threading.Monitor.PulseAll(this);
}
}
+
+ public void destroy()
+ {
+ //
+ // First wait for shutdown to finish.
+ //
+ waitForShutdown();
+
+ Hashtable adapters;
+
+ lock(this)
+ {
+ adapters = _adapters;
+
+ //
+ // We set _adapters to null because our destructor must not
+ // invoke methods on member objects.
+ //
+ _adapters = null;
+ }
+
+ foreach(Ice.ObjectAdapter adapter in adapters.Values)
+ {
+ adapter.destroy();
+ }
+ }
public Ice.ObjectAdapter createObjectAdapter(string name, string endpoints, Ice.RouterPrx router)
{
@@ -175,7 +193,7 @@ namespace IceInternal
{
lock(this)
{
- if(_waitForShutdown)
+ if(_waitForShutdown || _adapters == null)
{
return;
}