summaryrefslogtreecommitdiff
path: root/cs
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2005-09-07 16:14:20 +0000
committerBrent Eagles <brent@zeroc.com>2005-09-07 16:14:20 +0000
commit4e631700d66c51a96210e2bcbd8b3f63d8b0b9f4 (patch)
tree5b0d75ebdea90cbdfb6c3955b601ece88ccbceee /cs
parentBug 371: closeSocket can hide real errors (diff)
downloadice-4e631700d66c51a96210e2bcbd8b3f63d8b0b9f4.tar.bz2
ice-4e631700d66c51a96210e2bcbd8b3f63d8b0b9f4.tar.xz
ice-4e631700d66c51a96210e2bcbd8b3f63d8b0b9f4.zip
revising fixes for bug 431
Diffstat (limited to 'cs')
-rwxr-xr-xcs/src/Ice/CommunicatorI.cs15
-rwxr-xr-xcs/src/Ice/ObjectAdapterFactory.cs4
-rwxr-xr-xcs/src/Ice/ObjectAdapterI.cs8
-rwxr-xr-xcs/test/Ice/exceptions/AllTests.cs14
4 files changed, 21 insertions, 20 deletions
diff --git a/cs/src/Ice/CommunicatorI.cs b/cs/src/Ice/CommunicatorI.cs
index 77ded6554c7..22128e75313 100755
--- a/cs/src/Ice/CommunicatorI.cs
+++ b/cs/src/Ice/CommunicatorI.cs
@@ -39,23 +39,12 @@ namespace Ice
public ObjectAdapter createObjectAdapter(string name)
{
- return _instance.objectAdapterFactory().createObjectAdapter(name);
+ return createObjectAdapterWithEndpoints(name, getProperties().getProperty(name + ".Endpoints"));
}
public ObjectAdapter createObjectAdapterWithEndpoints(string name, string endpoints)
{
- string propertyKey = name + ".Endpoints";
- string originalValue = getProperties().getProperty(propertyKey);
- try
- {
- getProperties().setProperty(propertyKey, endpoints);
- return createObjectAdapter(name);
- }
- catch(AlreadyRegisteredException ex)
- {
- getProperties().setProperty(propertyKey, originalValue);
- throw ex;
- }
+ return _instance.objectAdapterFactory().createObjectAdapter(name, endpoints);
}
public void addObjectFactory(ObjectFactory factory, string id)
diff --git a/cs/src/Ice/ObjectAdapterFactory.cs b/cs/src/Ice/ObjectAdapterFactory.cs
index a9a99f353cb..0b5a4418474 100755
--- a/cs/src/Ice/ObjectAdapterFactory.cs
+++ b/cs/src/Ice/ObjectAdapterFactory.cs
@@ -101,7 +101,7 @@ namespace IceInternal
}
}
- public Ice.ObjectAdapter createObjectAdapter(string name)
+ public Ice.ObjectAdapter createObjectAdapter(string name, string endpoints)
{
lock(this)
{
@@ -119,7 +119,7 @@ namespace IceInternal
throw ex;
}
- adapter = new Ice.ObjectAdapterI(_instance, _communicator, name);
+ adapter = new Ice.ObjectAdapterI(_instance, _communicator, name, endpoints);
_adapters[name] = adapter;
return adapter;
}
diff --git a/cs/src/Ice/ObjectAdapterI.cs b/cs/src/Ice/ObjectAdapterI.cs
index aa00d680721..2c7118b4234 100755
--- a/cs/src/Ice/ObjectAdapterI.cs
+++ b/cs/src/Ice/ObjectAdapterI.cs
@@ -717,7 +717,8 @@ namespace Ice
//
// Only for use by IceInternal.ObjectAdapterFactory
//
- public ObjectAdapterI(IceInternal.Instance instance, Communicator communicator, string name)
+ public ObjectAdapterI(IceInternal.Instance instance, Communicator communicator, string name,
+ string endpointInfo)
{
_deactivated = false;
_instance = instance;
@@ -738,8 +739,7 @@ namespace Ice
// The connection factory might change it, for example, to
// fill in the real port number.
//
- string endpts = _instance.properties().getProperty(name + ".Endpoints");
- ArrayList endpoints = parseEndpoints(endpts);
+ ArrayList endpoints = parseEndpoints(endpointInfo);
for(int i = 0; i < endpoints.Count; ++i)
{
IceInternal.Endpoint endp = (IceInternal.Endpoint)endpoints[i];
@@ -750,7 +750,7 @@ namespace Ice
// Parse published endpoints. These are used in proxies
// instead of the connection factory endpoints.
//
- endpts = _instance.properties().getProperty(name + ".PublishedEndpoints");
+ string endpts = _instance.properties().getProperty(name + ".PublishedEndpoints");
_publishedEndpoints = parseEndpoints(endpts);
string router = _instance.properties().getProperty(name + ".Router");
diff --git a/cs/test/Ice/exceptions/AllTests.cs b/cs/test/Ice/exceptions/AllTests.cs
index e60f0f9ff10..cf85e711a12 100755
--- a/cs/test/Ice/exceptions/AllTests.cs
+++ b/cs/test/Ice/exceptions/AllTests.cs
@@ -674,8 +674,20 @@ public class AllTests
{
// Expected.
}
+
+ communicator.getProperties().setProperty("TestAdapter0.Endpoints", "");
+ try
+ {
+ Ice.ObjectAdapter second =
+ communicator.createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12346 -t 10000");
+ test(false);
+ }
+ catch(Ice.AlreadyRegisteredException)
+ {
+ // Expected
+ }
+ test(communicator.getProperties().getProperty("TestAdapter0.Endpoints").Equals(""));
first.deactivate();
-
Console.WriteLine("ok");
}