summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-10-09 16:03:12 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-10-09 16:03:12 -0230
commit0bb57b389cd9f57ddeb6ab115ccfb5bc7f07a09e (patch)
treeb9836942ec10171075ddbeb2c68dd529da746e0c
parentWindows TP README updates (diff)
downloadice-0bb57b389cd9f57ddeb6ab115ccfb5bc7f07a09e.tar.bz2
ice-0bb57b389cd9f57ddeb6ab115ccfb5bc7f07a09e.tar.xz
ice-0bb57b389cd9f57ddeb6ab115ccfb5bc7f07a09e.zip
ICE-5671 make sure router/locator have not already been set by plugin loading
-rw-r--r--cpp/src/Ice/Instance.cpp23
-rw-r--r--cs/src/Ice/Instance.cs23
-rw-r--r--java/src/IceInternal/Instance.java25
-rw-r--r--js/src/Ice/Instance.js7
4 files changed, 45 insertions, 33 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index a14a07f16c4..46e86c10b3e 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -1553,20 +1553,25 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
_clientThreadPool = new ThreadPool(this, "Ice.ThreadPool.Client", 0);
//
- // Get default router and locator proxies. Don't move this
- // initialization before the plug-in initialization!!! The proxies
- // might depend on endpoint factories to be installed by plug-ins.
+ // The default router/locator may have been set during the loading of plugins.
+ // Therefore we make sure it is not already set before checking the property.
//
- RouterPrx router = RouterPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Router"));
- if(router)
+ if(!_referenceFactory->getDefaultRouter())
{
- _referenceFactory = _referenceFactory->setDefaultRouter(router);
+ RouterPrx router = RouterPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Router"));
+ if(router)
+ {
+ _referenceFactory = _referenceFactory->setDefaultRouter(router);
+ }
}
- LocatorPrx locator = LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator"));
- if(locator)
+ if(!_referenceFactory->getDefaultLocator())
{
- _referenceFactory = _referenceFactory->setDefaultLocator(locator);
+ LocatorPrx locator = LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator"));
+ if(locator)
+ {
+ _referenceFactory = _referenceFactory->setDefaultLocator(locator);
+ }
}
//
diff --git a/cs/src/Ice/Instance.cs b/cs/src/Ice/Instance.cs
index 5f92169a664..03b6a11fb06 100644
--- a/cs/src/Ice/Instance.cs
+++ b/cs/src/Ice/Instance.cs
@@ -1010,20 +1010,25 @@ namespace IceInternal
_clientThreadPool = new ThreadPool(this, "Ice.ThreadPool.Client", 0);
//
- // Get default router and locator proxies. Don't move this
- // initialization before the plug-in initialization!!! The proxies
- // might depend on endpoint factories to be installed by plug-ins.
+ // The default router/locator may have been set during the loading of plugins.
+ // Therefore we make sure it is not already set before checking the property.
//
- Ice.RouterPrx r = Ice.RouterPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Router"));
- if(r != null)
+ if(_referenceFactory.getDefaultRouter() == null)
{
- _referenceFactory = _referenceFactory.setDefaultRouter(r);
+ Ice.RouterPrx r = Ice.RouterPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Router"));
+ if(r != null)
+ {
+ _referenceFactory = _referenceFactory.setDefaultRouter(r);
+ }
}
- Ice.LocatorPrx l = Ice.LocatorPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Locator"));
- if(l != null)
+ if(_referenceFactory.getDefaultLocator() == null)
{
- _referenceFactory = _referenceFactory.setDefaultLocator(l);
+ Ice.LocatorPrx l = Ice.LocatorPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Locator"));
+ if(l != null)
+ {
+ _referenceFactory = _referenceFactory.setDefaultLocator(l);
+ }
}
//
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java
index 00b12778726..900784eafd5 100644
--- a/java/src/IceInternal/Instance.java
+++ b/java/src/IceInternal/Instance.java
@@ -1100,20 +1100,27 @@ public final class Instance
_clientThreadPool = new ThreadPool(this, "Ice.ThreadPool.Client", 0);
//
- // Get default router and locator proxies. Don't move this
- // initialization before the plug-in initialization!!! The proxies
- // might depend on endpoint factories to be installed by plug-ins.
+ // The default router/locator may have been set during the loading of plugins.
+ // Therefore we make sure it is not already set before checking the property.
//
- Ice.RouterPrx router = Ice.RouterPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Router"));
- if(router != null)
+ if(_referenceFactory.getDefaultRouter() == null)
{
- _referenceFactory = _referenceFactory.setDefaultRouter(router);
+ Ice.RouterPrx router =
+ Ice.RouterPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Router"));
+ if(router != null)
+ {
+ _referenceFactory = _referenceFactory.setDefaultRouter(router);
+ }
}
- Ice.LocatorPrx loc = Ice.LocatorPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Locator"));
- if(loc != null)
+ if(_referenceFactory.getDefaultLocator() == null)
{
- _referenceFactory = _referenceFactory.setDefaultLocator(loc);
+ Ice.LocatorPrx loc =
+ Ice.LocatorPrxHelper.uncheckedCast(_proxyFactory.propertyToProxy("Ice.Default.Locator"));
+ if(loc != null)
+ {
+ _referenceFactory = _referenceFactory.setDefaultLocator(loc);
+ }
}
//
diff --git a/js/src/Ice/Instance.js b/js/src/Ice/Instance.js
index ab846d7abec..67b033059f4 100644
--- a/js/src/Ice/Instance.js
+++ b/js/src/Ice/Instance.js
@@ -349,7 +349,7 @@ var Instance = Ice.Class({
var sslInstance = new Ice.ProtocolInstance(this, IceSSL.EndpointType, "ssl", true);
var sslEndpointFactory = new Ice.TcpEndpointFactory(sslInstance);
this._endpointFactoryManager.add(sslEndpointFactory);
-
+
var wssInstance = new Ice.ProtocolInstance(this, Ice.WSSEndpointType, "wss", true);
var wssEndpointFactory = new Ice.WSEndpointFactory(wssInstance, sslEndpointFactory.clone(wssInstance));
this._endpointFactoryManager.add(wssEndpointFactory);
@@ -361,11 +361,6 @@ var Instance = Ice.Class({
this._retryQueue = new RetryQueue(this);
- //
- // Get default router and locator proxies. Don't move this
- // initialization before the plug-in initialization!!! The proxies
- // might depend on endpoint factories to be installed by plug-ins.
- //
var router = Ice.RouterPrx.uncheckedCast(this._proxyFactory.propertyToProxy("Ice.Default.Router"));
if(router !== null)
{