summaryrefslogtreecommitdiff
path: root/cs/src/Ice/EndpointFactoryManager.cs
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /cs/src/Ice/EndpointFactoryManager.cs
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'cs/src/Ice/EndpointFactoryManager.cs')
-rwxr-xr-xcs/src/Ice/EndpointFactoryManager.cs210
1 files changed, 105 insertions, 105 deletions
diff --git a/cs/src/Ice/EndpointFactoryManager.cs b/cs/src/Ice/EndpointFactoryManager.cs
index 324eebbd39a..541489b848a 100755
--- a/cs/src/Ice/EndpointFactoryManager.cs
+++ b/cs/src/Ice/EndpointFactoryManager.cs
@@ -16,111 +16,111 @@ namespace IceInternal
public sealed class EndpointFactoryManager
{
- internal EndpointFactoryManager(Instance instance)
- {
- instance_ = instance;
- _factories = new ArrayList();
- }
-
- public void add(EndpointFactory factory)
- {
- lock(this)
- {
- for(int i = 0; i < _factories.Count; i++)
- {
- EndpointFactory f = (EndpointFactory)_factories[i];
- if(f.type() == factory.type())
- {
- Debug.Assert(false);
- }
- }
- _factories.Add(factory);
- }
- }
-
- public EndpointFactory get(short type)
- {
- lock(this)
- {
- for(int i = 0; i < _factories.Count; i++)
- {
- EndpointFactory f = (EndpointFactory)_factories[i];
- if(f.type() == type)
- {
- return f;
- }
- }
- return null;
- }
- }
-
- public EndpointI create(string str)
- {
- lock(this)
- {
- string s = str.Trim();
- if(s.Length == 0)
- {
- Ice.EndpointParseException e = new Ice.EndpointParseException();
- e.str = str;
- throw e;
- }
-
- Regex p = new Regex("([ \t\n\r]+)|$");
- Match m = p.Match(s);
- Debug.Assert(m.Success);
-
- string protocol = s.Substring(0, m.Index);
-
- if(protocol.Equals("default"))
- {
- protocol = instance_.defaultsAndOverrides().defaultProtocol;
- }
-
- for(int i = 0; i < _factories.Count; i++)
- {
- EndpointFactory f = (EndpointFactory)_factories[i];
- if(f.protocol().Equals(protocol))
- {
- return f.create(s.Substring(m.Index + m.Length));
- }
- }
-
- return null;
- }
- }
-
- public EndpointI read(BasicStream s)
- {
- lock(this)
- {
- short type = s.readShort();
-
- for(int i = 0; i < _factories.Count; i++)
- {
- EndpointFactory f = (EndpointFactory)_factories[i];
- if(f.type() == type)
- {
- return f.read(s);
- }
- }
-
- return new UnknownEndpointI(type, s);
- }
- }
-
- internal void destroy()
- {
- for(int i = 0; i < _factories.Count; i++)
- {
- EndpointFactory f = (EndpointFactory)_factories[i];
- f.destroy();
- }
- _factories.Clear();
- }
-
- private readonly Instance instance_;
- private readonly ArrayList _factories;
+ internal EndpointFactoryManager(Instance instance)
+ {
+ instance_ = instance;
+ _factories = new ArrayList();
+ }
+
+ public void add(EndpointFactory factory)
+ {
+ lock(this)
+ {
+ for(int i = 0; i < _factories.Count; i++)
+ {
+ EndpointFactory f = (EndpointFactory)_factories[i];
+ if(f.type() == factory.type())
+ {
+ Debug.Assert(false);
+ }
+ }
+ _factories.Add(factory);
+ }
+ }
+
+ public EndpointFactory get(short type)
+ {
+ lock(this)
+ {
+ for(int i = 0; i < _factories.Count; i++)
+ {
+ EndpointFactory f = (EndpointFactory)_factories[i];
+ if(f.type() == type)
+ {
+ return f;
+ }
+ }
+ return null;
+ }
+ }
+
+ public EndpointI create(string str)
+ {
+ lock(this)
+ {
+ string s = str.Trim();
+ if(s.Length == 0)
+ {
+ Ice.EndpointParseException e = new Ice.EndpointParseException();
+ e.str = str;
+ throw e;
+ }
+
+ Regex p = new Regex("([ \t\n\r]+)|$");
+ Match m = p.Match(s);
+ Debug.Assert(m.Success);
+
+ string protocol = s.Substring(0, m.Index);
+
+ if(protocol.Equals("default"))
+ {
+ protocol = instance_.defaultsAndOverrides().defaultProtocol;
+ }
+
+ for(int i = 0; i < _factories.Count; i++)
+ {
+ EndpointFactory f = (EndpointFactory)_factories[i];
+ if(f.protocol().Equals(protocol))
+ {
+ return f.create(s.Substring(m.Index + m.Length));
+ }
+ }
+
+ return null;
+ }
+ }
+
+ public EndpointI read(BasicStream s)
+ {
+ lock(this)
+ {
+ short type = s.readShort();
+
+ for(int i = 0; i < _factories.Count; i++)
+ {
+ EndpointFactory f = (EndpointFactory)_factories[i];
+ if(f.type() == type)
+ {
+ return f.read(s);
+ }
+ }
+
+ return new UnknownEndpointI(type, s);
+ }
+ }
+
+ internal void destroy()
+ {
+ for(int i = 0; i < _factories.Count; i++)
+ {
+ EndpointFactory f = (EndpointFactory)_factories[i];
+ f.destroy();
+ }
+ _factories.Clear();
+ }
+
+ private readonly Instance instance_;
+ private readonly ArrayList _factories;
}
}