summaryrefslogtreecommitdiff
path: root/cs/src/Ice/ObjectFactoryManager.cs
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-05-27 07:06:38 +0000
committerMichi Henning <michi@zeroc.com>2004-05-27 07:06:38 +0000
commit19268f4cde69a31be6f7b9175610fd65be6b12fd (patch)
tree9713b4dfea7bfd16f533de89e525b769849b6b29 /cs/src/Ice/ObjectFactoryManager.cs
parentImproved comment. (diff)
downloadice-19268f4cde69a31be6f7b9175610fd65be6b12fd.tar.bz2
ice-19268f4cde69a31be6f7b9175610fd65be6b12fd.tar.xz
ice-19268f4cde69a31be6f7b9175610fd65be6b12fd.zip
More catch-up with 1.4.0 changes.
Diffstat (limited to 'cs/src/Ice/ObjectFactoryManager.cs')
-rwxr-xr-xcs/src/Ice/ObjectFactoryManager.cs144
1 files changed, 75 insertions, 69 deletions
diff --git a/cs/src/Ice/ObjectFactoryManager.cs b/cs/src/Ice/ObjectFactoryManager.cs
index b565e9557a6..08cc052ce6f 100755
--- a/cs/src/Ice/ObjectFactoryManager.cs
+++ b/cs/src/Ice/ObjectFactoryManager.cs
@@ -7,72 +7,78 @@
//
// **********************************************************************
-
-namespace IceInternal
-{
-
- using System.Collections;
-
- public sealed class ObjectFactoryManager
- {
- public void add(Ice.ObjectFactory factory, string id)
- {
- lock(this)
- {
- object o = _factoryMap[id];
- if(o != null)
- {
- Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
- ex.id = id;
- ex.kindOfObject = "user exception factory";
- throw ex;
- }
- _factoryMap[id] = factory;
- }
- }
-
- public void remove(string id)
- {
- lock(this)
- {
- object o = _factoryMap[id];
- if(o == null)
- {
- Ice.NotRegisteredException ex = new Ice.NotRegisteredException();
- ex.id = id;
- ex.kindOfObject = "user exception factory";
- throw ex;
- }
- _factoryMap.Remove(id);
- }
- }
-
- public Ice.ObjectFactory find(string id)
- {
- lock(this)
- {
- return (Ice.ObjectFactory)_factoryMap[id];
- }
- }
-
- //
- // Only for use by Instance
- //
- internal ObjectFactoryManager()
- {
- _factoryMap = new Hashtable();
- }
-
- internal void destroy()
- {
- foreach(Ice.ObjectFactory factory in _factoryMap.Values)
- {
- factory.destroy();
- }
- _factoryMap.Clear();
- }
-
- private Hashtable _factoryMap;
- }
-
-}
+
+namespace IceInternal
+{
+
+ using System.Collections;
+
+ public sealed class ObjectFactoryManager
+ {
+ public void add(Ice.ObjectFactory factory, string id)
+ {
+ lock(this)
+ {
+ object o = _factoryMap[id];
+ if(o != null)
+ {
+ Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
+ ex.id = id;
+ ex.kindOfObject = "object factory";
+ throw ex;
+ }
+ _factoryMap[id] = factory;
+ }
+ }
+
+ public void remove(string id)
+ {
+ lock(this)
+ {
+ object o = _factoryMap[id];
+ if(o == null)
+ {
+ Ice.NotRegisteredException ex = new Ice.NotRegisteredException();
+ ex.id = id;
+ ex.kindOfObject = "object factory";
+ throw ex;
+ }
+
+ ((Ice.ObjectFactory)o).destroy();
+
+ _factoryMap.Remove(id);
+ }
+ }
+
+ public Ice.ObjectFactory find(string id)
+ {
+ lock(this)
+ {
+ return (Ice.ObjectFactory)_factoryMap[id];
+ }
+ }
+
+ //
+ // Only for use by Instance
+ //
+ internal ObjectFactoryManager()
+ {
+ _factoryMap = new Hashtable();
+ }
+
+ internal void destroy()
+ {
+ lock(this)
+ {
+ foreach(Ice.ObjectFactory factory in _factoryMap.Values)
+ {
+ factory.destroy();
+ }
+ _factoryMap.Clear();
+ }
+ }
+
+ private Hashtable _factoryMap;
+ }
+
+}