diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-06-28 19:20:18 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-06-28 19:20:18 +0000 |
commit | 75ac12c02d537f38b03567e406cbeccf29226fe0 (patch) | |
tree | 4add4682e2aa8edd9c58f1a23ad3f0ccc8336d02 /cpp/src/Ice/Instance.cpp | |
parent | Replaced invalid struct name Struct with Structure. (diff) | |
download | ice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.bz2 ice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.xz ice-75ac12c02d537f38b03567e406cbeccf29226fe0.zip |
Merged location branch.
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 62bc82a4486..fd3e2a06c1c 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -12,6 +12,7 @@ #include <Ice/TraceLevels.h> #include <Ice/DefaultsAndOverrides.h> #include <Ice/RouterInfo.h> +#include <Ice/LocatorInfo.h> #include <Ice/ReferenceFactory.h> #include <Ice/ProxyFactory.h> #include <Ice/ThreadPool.h> @@ -28,6 +29,7 @@ #include <Ice/TcpEndpoint.h> #include <Ice/UdpEndpoint.h> #include <Ice/PluginManagerI.h> +#include <Ice/Communicator.h> #include <Ice/Initialize.h> #ifndef _WIN32 @@ -121,6 +123,13 @@ IceInternal::Instance::routerManager() return _routerManager; } +LocatorManagerPtr +IceInternal::Instance::locatorManager() +{ + IceUtil::RecMutex::Lock sync(*this); + return _locatorManager; +} + ReferenceFactoryPtr IceInternal::Instance::referenceFactory() { @@ -308,6 +317,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, _routerManager = new RouterManager; + _locatorManager = new LocatorManager; + _referenceFactory = new ReferenceFactory(this); _proxyFactory = new ProxyFactory(this); @@ -320,12 +331,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, _pluginManager = new PluginManagerI(this); - if(!_defaultsAndOverrides->defaultRouter.empty()) - { - _referenceFactory->setDefaultRouter( - RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultRouter))); - } - _outgoingConnectionFactory = new OutgoingConnectionFactory(this); _servantFactoryManager = new ObjectFactoryManager(); @@ -357,6 +362,7 @@ IceInternal::Instance::~Instance() assert(!_clientThreadPool); assert(!_serverThreadPool); assert(!_routerManager); + assert(!_locatorManager); assert(!_endpointFactoryManager); assert(!_pluginManager); @@ -405,6 +411,23 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) assert(pluginManagerImpl); pluginManagerImpl->loadPlugins(argc, argv); + // + // 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. + // + if(!_defaultsAndOverrides->defaultRouter.empty()) + { + _referenceFactory->setDefaultRouter( + RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultRouter))); + } + + if(!_defaultsAndOverrides->defaultLocator.empty()) + { + _referenceFactory->setDefaultLocator( + LocatorPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultLocator))); + } + #ifndef _WIN32 // // daemon() must be called after any plug-ins have been @@ -520,12 +543,18 @@ IceInternal::Instance::destroy() _routerManager = 0; } + if(_locatorManager) + { + _locatorManager->destroy(); + _locatorManager = 0; + } + if(_endpointFactoryManager) { _endpointFactoryManager->destroy(); _endpointFactoryManager = 0; } - + // // We destroy the thread pool outside the thread // synchronization. |