diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
commit | 630a37d2fe66f24518299e705f958b571803c522 (patch) | |
tree | 969723791bdc4d73bb099c19d45554d0ca241ad9 /cs/src/Ice/ObjectFactoryManager.cs | |
parent | Fix some README.md markdown formatting (diff) | |
download | ice-630a37d2fe66f24518299e705f958b571803c522.tar.bz2 ice-630a37d2fe66f24518299e705f958b571803c522.tar.xz ice-630a37d2fe66f24518299e705f958b571803c522.zip |
py -> python
rb -> ruby
objc -> objective-c
cs -> csharp
Diffstat (limited to 'cs/src/Ice/ObjectFactoryManager.cs')
-rw-r--r-- | cs/src/Ice/ObjectFactoryManager.cs | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/cs/src/Ice/ObjectFactoryManager.cs b/cs/src/Ice/ObjectFactoryManager.cs deleted file mode 100644 index e211713ed55..00000000000 --- a/cs/src/Ice/ObjectFactoryManager.cs +++ /dev/null @@ -1,86 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -namespace IceInternal -{ - - using System.Collections.Generic; - - public sealed class ObjectFactoryManager - { - public void add(Ice.ObjectFactory factory, string id) - { - lock(this) - { - if(_factoryMap.ContainsKey(id)) - { - Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); - ex.id = id; - ex.kindOfObject = "object factory"; - throw ex; - } - _factoryMap[id] = factory; - } - } - - public void remove(string id) - { - object o = null; - lock(this) - { - if(!_factoryMap.ContainsKey(id)) - { - Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); - ex.id = id; - ex.kindOfObject = "object factory"; - throw ex; - } - _factoryMap.Remove(id); - } - ((Ice.ObjectFactory)o).destroy(); - } - - public Ice.ObjectFactory find(string id) - { - lock(this) - { - Ice.ObjectFactory factory = null; - _factoryMap.TryGetValue(id, out factory); - return factory; - } - } - - // - // Only for use by Instance - // - internal ObjectFactoryManager() - { - _factoryMap = new Dictionary<string, Ice.ObjectFactory>(); - } - - internal void destroy() - { - Dictionary<string, Ice.ObjectFactory> oldMap = null; - - lock(this) - { - oldMap = _factoryMap; - _factoryMap = new Dictionary<string, Ice.ObjectFactory>(); - } - - foreach(Ice.ObjectFactory factory in oldMap.Values) - { - factory.destroy(); - } - } - - private Dictionary<string, Ice.ObjectFactory> _factoryMap; - } - -} |