diff options
author | Marc Laukien <marc@zeroc.com> | 2002-05-08 13:01:07 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-05-08 13:01:07 +0000 |
commit | 79e662aaa93cea43aabb8f160883a642679360d8 (patch) | |
tree | 5564c6c9f6acba8aef7500a5ed55ab253fd76b0e /cpp | |
parent | initial compression (diff) | |
download | ice-79e662aaa93cea43aabb8f160883a642679360d8.tar.bz2 ice-79e662aaa93cea43aabb8f160883a642679360d8.tar.xz ice-79e662aaa93cea43aabb8f160883a642679360d8.zip |
DefaultsAndOverwrites
Diffstat (limited to 'cpp')
25 files changed, 223 insertions, 113 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py index 8410290b0a8..2d33e643a4d 100644 --- a/cpp/config/TestUtil.py +++ b/cpp/config/TestUtil.py @@ -33,11 +33,11 @@ host = "" if protocol == "ssl": plugin = " --Ice.Plugin.IceSSL=IceSSL:create" - clientProtocol = plugin + " --Ice.DefaultProtocol=ssl" + \ + clientProtocol = plugin + " --Ice.Default.Protocol=ssl" + \ " --IceSSL.Client.CertPath=TOPLEVELDIR/certs --IceSSL.Client.Config=client_sslconfig.xml" - serverProtocol = plugin + " --Ice.DefaultProtocol=ssl" + \ + serverProtocol = plugin + " --Ice.Default.Protocol=ssl" + \ " --IceSSL.Server.CertPath=TOPLEVELDIR/certs --IceSSL.Server.Config=server_sslconfig.xml" - clientServerProtocol = plugin + " --Ice.DefaultProtocol=ssl" + \ + clientServerProtocol = plugin + " --Ice.Default.Protocol=ssl" + \ " --IceSSL.Client.CertPath=TOPLEVELDIR/certs --IceSSL.Client.Config=sslconfig.xml" + \ " --IceSSL.Server.CertPath=TOPLEVELDIR/certs --IceSSL.Server.Config=sslconfig.xml" else: @@ -46,7 +46,7 @@ else: clientServerProtocol = "" if host != "": - defaultHost = " --Ice.DefaultHost=" + host + defaultHost = " --Ice.Default.Host=" + host else: defaultHost = "" diff --git a/cpp/demo/Glacier/session/config b/cpp/demo/Glacier/session/config index 841b93d7e59..03f997fad21 100644 --- a/cpp/demo/Glacier/session/config +++ b/cpp/demo/Glacier/session/config @@ -69,4 +69,4 @@ Glacier.Starter.PropertiesOverwrite=Ice.ServerIdleTime=60 # # Uncomment the following lines if you want to run this demo with Glacier # -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 diff --git a/cpp/demo/Ice/callback/config b/cpp/demo/Ice/callback/config index 0b57a5b9b79..451eb54486a 100644 --- a/cpp/demo/Ice/callback/config +++ b/cpp/demo/Ice/callback/config @@ -20,6 +20,6 @@ Glacier.Router.Trace.Server=2 Glacier.Router.Trace.RoutingTable=1 # Uncomment the following lines if you want to run this demo with Glacier -Ice.DefaultRouter=Glacier/router:default -p 10005 +Ice.Default.Router=Glacier/router:default -p 10005 Ice.Adapter.CallbackReceiverAdapter.Router=Glacier/router:default -p 10005 Ice.Adapter.CallbackReceiverAdapter.Endpoints= diff --git a/cpp/demo/Ice/hello/config b/cpp/demo/Ice/hello/config index 369e76cc4fa..40e29751253 100644 --- a/cpp/demo/Ice/hello/config +++ b/cpp/demo/Ice/hello/config @@ -66,4 +66,4 @@ Glacier.Router.Trace.RoutingTable=1 # # Uncomment the following lines if you want to run this demo with Glacier # -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 diff --git a/cpp/demo/Ice/latency/config b/cpp/demo/Ice/latency/config index 6fb5b2a9e10..931155f5bc2 100644 --- a/cpp/demo/Ice/latency/config +++ b/cpp/demo/Ice/latency/config @@ -11,4 +11,4 @@ Glacier.Router.Endpoints=default -p 10005 Glacier.Router.Client.Endpoints=default # Uncomment the following lines if you want to run this demo with Glacier -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 diff --git a/cpp/demo/Ice/nested/config b/cpp/demo/Ice/nested/config index 5b196f27efd..8f863717fef 100644 --- a/cpp/demo/Ice/nested/config +++ b/cpp/demo/Ice/nested/config @@ -21,6 +21,6 @@ Glacier.Router.Trace.Server=2 Glacier.Router.Trace.RoutingTable=1 # Uncomment the following lines if you want to run this demo with Glacier -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 #Ice.Adapter.NestedClientAdapter.Router=Glacier/router:default -p 10005 #Ice.Adapter.NestedClientAdapter.Endpoints= diff --git a/cpp/demo/Ice/value/config b/cpp/demo/Ice/value/config index 41023c99949..d06219e3768 100644 --- a/cpp/demo/Ice/value/config +++ b/cpp/demo/Ice/value/config @@ -13,4 +13,4 @@ Glacier.Router.Trace.Client=2 Glacier.Router.Trace.RoutingTable=1 # Uncomment the following lines if you want to run this demo with Glacier -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 diff --git a/cpp/demo/IceBox/hello/config b/cpp/demo/IceBox/hello/config index 596d2f084ba..0a38457477a 100644 --- a/cpp/demo/IceBox/hello/config +++ b/cpp/demo/IceBox/hello/config @@ -76,4 +76,4 @@ Glacier.Trace.RoutingTable=1 # # Uncomment the following lines if you want to run this demo with Glacier # -#Ice.DefaultRouter=Glacier/router:default -p 10005 +#Ice.Default.Router=Glacier/router:default -p 10005 diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml index c889b054389..6ddd50a0692 100644 --- a/cpp/doc/Properties.sgml +++ b/cpp/doc/Properties.sgml @@ -118,7 +118,7 @@ The request retry tracing level: </section> <!-- ********************************************************************** --> -<section><title>&Ice; object adapter Properties</title> +<section><title>&Ice; Object Adapter Properties</title> <!-- ********************************************************************** --> <section><title>Ice.Adapter.<replaceable>name</replaceable>.Endpoints</title> @@ -139,6 +139,47 @@ has been created with </section> </section> +<section><title>Ice.Adapter.<replaceable>name</replaceable>.Router</title> +<section><title>Synopsis</title> +<synopsis> +Ice.Adapter.<replaceable>name</replaceable>.Router=<replaceable>router</replaceable> +</synopsis> +</section> +<section> +<title>Description</title> +<para> +Specifies a router (as stingified proxy to the &Glacier; router +control interface) for the object adapter with the name +<replaceable>name</replaceable>. By doing so, the object adapter can +receive callbacks from this router, using connections which are +established from this process to the router, instead of the router +having to establish a connection back to the named object adapter. +<note><para> You can only specify a particular router for one single +object adapter. Specifying the same router for more than one object +adapter will result in undefined behavior. The default value is no +router. </para></note> +</para> +</section> +</section> + +<section><title>Ice.PrintAdapterReady</title> +<section><title>Synopsis</title> +<synopsis> +Ice.PrintAdapterReady=<replaceable>num</replaceable> +</synopsis> +</section> +<section> +<title>Description</title> +<para> +If <replaceable>num</replaceable> is set to a value larger than zero, +an object adapter prints "<replaceable>adapter_name</replaceable> +ready" on standard output after initialization is complete. This is +useful for scripts that wish to wait until an object adapter is ready +to be used. +</para> +</section> +</section> + </section> <!-- ********************************************************************** --> @@ -209,13 +250,13 @@ method invocations). </para></note> </section> <!-- ********************************************************************** --> -<section><title>&Ice; Protocol Properties</title> +<section><title>&Ice; Default and Overwrite Properties</title> <!-- ********************************************************************** --> -<section><title>Ice.DefaultProtocol</title> +<section><title>Ice.Default.Protocol</title> <section><title>Synopsis</title> <synopsis> -Ice.DefaultProtocol=<replaceable>protocol</replaceable> +Ice.Default.Protocol=<replaceable>protocol</replaceable> </synopsis> </section> <section> @@ -228,10 +269,10 @@ value is <literal>tcp</literal>. </section> </section> -<section><title>Ice.DefaultHost</title> +<section><title>Ice.Default.Host</title> <section><title>Synopsis</title> <synopsis> -Ice.DefaultHost=<replaceable>host</replaceable> +Ice.Default.Host=<replaceable>host</replaceable> </synopsis> </section> <section> @@ -245,16 +286,10 @@ instead. The default value is the local host name. </section> </section> -</section> - -<!-- ********************************************************************** --> -<section><title>&Ice; Routing Properties</title> -<!-- ********************************************************************** --> - -<section><title>Ice.DefaultRouter</title> +<section><title>Ice.Default.Router</title> <section><title>Synopsis</title> <synopsis> -Ice.DefaultRouter=<replaceable>router</replaceable> +Ice.Default.Router=<replaceable>router</replaceable> </synopsis> </section> <section> @@ -262,36 +297,13 @@ Ice.DefaultRouter=<replaceable>router</replaceable> <para> Specifies a default router (as stingified proxy to the &Glacier; router control interface) which is to be used for all proxies, unless -the router is overwritten with the proxy's +the router is overwritten with a proxy's <literal>ice_router()</literal> operation. The default value is no router. </para> </section> </section> -<section><title>Ice.Adapter.<replaceable>name</replaceable>.Router</title> -<section><title>Synopsis</title> -<synopsis> -Ice.Adapter.<replaceable>name</replaceable>.Router=<replaceable>router</replaceable> -</synopsis> -</section> -<section> -<title>Description</title> -<para> -Specifies a router (as stingified proxy to the &Glacier; router -control interface) for the object adapter with the name -<replaceable>name</replaceable>. By doing so, the object adapter can -receive callbacks from this router, using connections which are -established from this process to the router, instead of the router -having to establish a connection back to the named object adapter. -<note><para> You can only specify a particular router for one single -object adapter. Specifying the same router for more than one object -adapter will result in undefined behavior. The default value is no -router. </para></note> -</para> -</section> -</section> - </section> <!-- ********************************************************************** --> @@ -353,24 +365,6 @@ the process ID is printed on standard output upon startup. </section> </section> -<section><title>Ice.PrintAdapterReady</title> -<section><title>Synopsis</title> -<synopsis> -Ice.PrintAdapterReady=<replaceable>num</replaceable> -</synopsis> -</section> -<section> -<title>Description</title> -<para> -If <replaceable>num</replaceable> is set to a value larger than zero, -an object adapter prints "<replaceable>adapter_name</replaceable> -ready" on standard output after initialization is complete. This is -useful for scripts that wish to wait until an object adapter is ready -to be used. -</para> -</section> -</section> - <section><title>Ice.ProgramName</title> <section><title>Synopsis</title> <synopsis> @@ -444,7 +438,7 @@ conditions in connections. </section> <!-- ********************************************************************** --> -<section><title>&Ice; SSL Properties</title> +<section><title>&IceSSL; Properties</title> <!-- ********************************************************************** --> <section><title>IceSSL.Trace.Security</title> @@ -531,7 +525,7 @@ the same directory that it finds the XML configuration file. <para> Depending on whether the application is running in client mode, server mode or both modes, a valid value for one or both of these parameters must be specified -for the proper operation of the IceSSL extension. +for the proper operation of the &IceSSL; extension. </para> </section> </section> @@ -567,9 +561,9 @@ IceSSL.Server.Passphrase.Retries=<replaceable>number of retries</replaceable> <section> <title>Description</title> <para> -When IceSSL is directed to use a private key in a PEM file that has been encrypted, a prompt +When &IceSSL; is directed to use a private key in a PEM file that has been encrypted, a prompt is displayed "Enter PEM pass phrase:". In the case that the passphrase is incorrectly entered, -these properties define how many retries the user will get before IceSSL shuts down. +these properties define how many retries the user will get before &IceSSL; shuts down. </para> <para> If not specified, the default value for these properties is 5 retries. @@ -593,7 +587,7 @@ used by the Server context may be overridden from those specified in the config the DER representation of the private and public keys, base64 encoded. </para> <para> -There is not default value for these properties. +There are no default values for these properties. </para> </section> </section> @@ -614,7 +608,7 @@ used by the Server context may be overridden from those specified in the config the DER representation of the private and public keys, base64 encoded. </para> <para> -There is not default value for these properties. +There are no default values for these properties. </para> </section> </section> @@ -635,7 +629,7 @@ used by the Client context may be overridden from those specified in the config the DER representation of the private and public keys, base64 encoded. </para> <para> -There is not default value for these properties. +There are no default values for these properties. </para> </section> </section> @@ -656,7 +650,7 @@ used by the Client context may be overridden from those specified in the config the DER representation of the private and public keys, base64 encoded. </para> <para> -There is not default value for these properties. +There are no default values for these properties. </para> </section> </section> @@ -677,7 +671,7 @@ Authority (CA) certificates specified in <literal>IceSSL.Server.Config</literal> as the base64 encoding of the DER binary representation of the certificate. </para> <para> -There is not default value for these properties. +There are no default values for these properties. </para> </section> </section> diff --git a/cpp/doc/manual.sgml b/cpp/doc/manual.sgml index 161505f7e48..89a1cc18e92 100644 --- a/cpp/doc/manual.sgml +++ b/cpp/doc/manual.sgml @@ -1,6 +1,7 @@ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ <!ENTITY Ice "<phrase>Ice</phrase>"> +<!ENTITY IceSSL "<phrase>IceSSL</phrase>"> <!ENTITY IcePack "<phrase>IcePack</phrase>"> <!ENTITY IceStorm "<phrase>IceStorm</phrase>"> <!ENTITY Glacier "<phrase>Glacier</phrase>"> diff --git a/cpp/src/Glacier/GlacierRouter.cpp b/cpp/src/Glacier/GlacierRouter.cpp index 12e14962739..5e8e0c8e82b 100644 --- a/cpp/src/Glacier/GlacierRouter.cpp +++ b/cpp/src/Glacier/GlacierRouter.cpp @@ -310,7 +310,7 @@ main(int argc, char* argv[]) cerr << argv[0] << ": " << ex << endl; return EXIT_FAILURE; } - defaultProperties->setProperty("Ice.DefaultRouter", ""); + defaultProperties->setProperty("Ice.Default.Router", ""); Glacier::RouterApp app; return app.main(argc, argv); diff --git a/cpp/src/Glacier/GlacierStarter.cpp b/cpp/src/Glacier/GlacierStarter.cpp index d6261946db3..693cac79140 100644 --- a/cpp/src/Glacier/GlacierStarter.cpp +++ b/cpp/src/Glacier/GlacierStarter.cpp @@ -197,7 +197,7 @@ main(int argc, char* argv[]) cerr << argv[0] << ": " << ex << endl; return EXIT_FAILURE; } - defaultProperties->setProperty("Ice.DefaultRouter", ""); + defaultProperties->setProperty("Ice.Default.Router", ""); Glacier::RouterApp app; return app.main(argc, argv); diff --git a/cpp/src/Ice/DefaultsAndOverwrites.cpp b/cpp/src/Ice/DefaultsAndOverwrites.cpp new file mode 100644 index 00000000000..d757af2eb17 --- /dev/null +++ b/cpp/src/Ice/DefaultsAndOverwrites.cpp @@ -0,0 +1,53 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <Ice/DefaultsAndOverwrites.h> +#include <Ice/Properties.h> +#include <Ice/Network.h> + +using namespace std; +using namespace Ice; +using namespace IceInternal; + +void IceInternal::incRef(DefaultsAndOverwrites* p) { p->__incRef(); } +void IceInternal::decRef(DefaultsAndOverwrites* p) { p->__decRef(); } + +IceInternal::DefaultsAndOverwrites::DefaultsAndOverwrites(const PropertiesPtr& properties) : + overwriteTimeout(false), + overwriteTimeoutValue(-1), + overwriteCompress(false), + overwriteCompressValue(false) +{ + const_cast<string&>(defaultProtocol) = properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp"); + + const_cast<string&>(defaultHost) = properties->getProperty("Ice.Default.Host"); + if (defaultHost.empty()) + { + const_cast<string&>(defaultHost) = getLocalHost(true); + } + + const_cast<string&>(defaultRouter) = properties->getProperty("Ice.Default.Router"); + + string value; + + value = properties->getProperty("Ice.Overwrite.Timeout"); + if (!value.empty()) + { + const_cast<bool&>(overwriteTimeout) = true; + const_cast<Int&>(overwriteTimeoutValue) = atoi(value.c_str()); + } + + value = properties->getProperty("Ice.Overwrite.Compress"); + if (!value.empty()) + { + const_cast<bool&>(overwriteCompress) = true; + const_cast<bool&>(overwriteCompressValue) = atoi(value.c_str()); + } +} diff --git a/cpp/src/Ice/DefaultsAndOverwrites.h b/cpp/src/Ice/DefaultsAndOverwrites.h new file mode 100644 index 00000000000..99c5a0e297b --- /dev/null +++ b/cpp/src/Ice/DefaultsAndOverwrites.h @@ -0,0 +1,39 @@ +// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_ICE_DEFAULTS_AND_OVERWRITES_F_H +#define ICE_ICE_DEFAULTS_AND_OVERWRITES_F_H + +#include <IceUtil/Shared.h> +#include <Ice/DefaultsAndOverwritesF.h> +#include <Ice/PropertiesF.h> + +namespace IceInternal +{ + +class DefaultsAndOverwrites : public ::IceUtil::Shared +{ +public: + + DefaultsAndOverwrites(const ::Ice::PropertiesPtr&); + + std::string defaultHost; + std::string defaultProtocol; + std::string defaultRouter; + + bool overwriteTimeout; + Ice::Int overwriteTimeoutValue; + bool overwriteCompress; + bool overwriteCompressValue; +}; + +} + +#endif diff --git a/cpp/src/Ice/DefaultsAndOverwritesF.h b/cpp/src/Ice/DefaultsAndOverwritesF.h new file mode 100644 index 00000000000..9c3cf35a152 --- /dev/null +++ b/cpp/src/Ice/DefaultsAndOverwritesF.h @@ -0,0 +1,26 @@ +// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#ifndef ICE_DEFAULTS_AND_OVERWRITES_F_H +#define ICE_DEFAULTS_AND_OVERWRITES_F_H + +#include <Ice/Handle.h> + +namespace IceInternal +{ + +class DefaultsAndOverwrites; +void incRef(DefaultsAndOverwrites*); +void decRef(DefaultsAndOverwrites*); +typedef Handle<DefaultsAndOverwrites> DefaultsAndOverwritesPtr; + +} + +#endif diff --git a/cpp/src/Ice/EndpointFactoryManager.cpp b/cpp/src/Ice/EndpointFactoryManager.cpp index 164bf6f3560..67084de0056 100644 --- a/cpp/src/Ice/EndpointFactoryManager.cpp +++ b/cpp/src/Ice/EndpointFactoryManager.cpp @@ -14,6 +14,7 @@ #include <Ice/BasicStream.h> #include <Ice/LocalException.h> #include <Ice/Instance.h> +#include <Ice/DefaultsAndOverwrites.h> using namespace std; using namespace Ice; @@ -86,7 +87,7 @@ IceInternal::EndpointFactoryManager::create(const string& str) const if (protocol == "default") { - protocol = _instance->defaultProtocol(); + protocol = _instance->defaultsAndOverwrites()->defaultProtocol; } // diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index a8c807fe403..4750b0b2999 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -10,6 +10,7 @@ #include <Ice/Instance.h> #include <Ice/TraceLevels.h> +#include <Ice/DefaultsAndOverwrites.h> #include <Ice/RouterInfo.h> #include <Ice/ReferenceFactory.h> #include <Ice/ProxyFactory.h> @@ -106,18 +107,11 @@ IceInternal::Instance::traceLevels() return _traceLevels; } -string -IceInternal::Instance::defaultProtocol() +DefaultsAndOverwritesPtr +IceInternal::Instance::defaultsAndOverwrites() { // No mutex lock, immutable. - return _defaultProtocol; -} - -string -IceInternal::Instance::defaultHost() -{ - // No mutex lock, immutable. - return _defaultHost; + return _defaultsAndOverwrites; } RouterManagerPtr @@ -310,12 +304,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, _traceLevels = new TraceLevels(_properties); - _defaultProtocol = _properties->getPropertyWithDefault("Ice.DefaultProtocol", "tcp"); - _defaultHost = _properties->getProperty("Ice.DefaultHost"); - if (_defaultHost.empty()) - { - _defaultHost = getLocalHost(true); - } + _defaultsAndOverwrites = new DefaultsAndOverwrites(_properties); _routerManager = new RouterManager; @@ -323,9 +312,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, _proxyFactory = new ProxyFactory(this); - // - // Install TCP and UDP endpoint factories. - // _endpointFactoryManager = new EndpointFactoryManager(this); EndpointFactoryPtr tcpEndpointFactory = new TcpEndpointFactory(this); _endpointFactoryManager->add(tcpEndpointFactory); @@ -334,10 +320,10 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, int& argc, _pluginManager = new PluginManagerI(this); - string router = _properties->getProperty("Ice.DefaultRouter"); - if (!router.empty()) + if (!_defaultsAndOverwrites->defaultRouter.empty()) { - _referenceFactory->setDefaultRouter(RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(router))); + _referenceFactory->setDefaultRouter( + RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverwrites->defaultRouter))); } _outgoingConnectionFactory = new OutgoingConnectionFactory(this); diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 5e1b105dd35..f6b37cc8e0b 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -19,6 +19,7 @@ #include <Ice/PropertiesF.h> #include <Ice/LoggerF.h> #include <Ice/TraceLevelsF.h> +#include <Ice/DefaultsAndOverwritesF.h> #include <Ice/RouterInfoF.h> #include <Ice/ReferenceFactoryF.h> #include <Ice/ProxyFactoryF.h> @@ -50,6 +51,7 @@ public: ::Ice::LoggerPtr logger(); void logger(const ::Ice::LoggerPtr&); TraceLevelsPtr traceLevels(); + DefaultsAndOverwritesPtr defaultsAndOverwrites(); RouterManagerPtr routerManager(); ReferenceFactoryPtr referenceFactory(); ProxyFactoryPtr proxyFactory(); @@ -59,8 +61,6 @@ public: ObjectAdapterFactoryPtr objectAdapterFactory(); ThreadPoolPtr clientThreadPool(); ThreadPoolPtr serverThreadPool(); - std::string defaultProtocol(); - std::string defaultHost(); EndpointFactoryManagerPtr endpointFactoryManager(); ::Ice::PluginManagerPtr pluginManager(); @@ -76,6 +76,7 @@ private: ::Ice::PropertiesPtr _properties; // Immutable, not reset by destroy(). ::Ice::LoggerPtr _logger; // Not reset by destroy(). TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy(). + DefaultsAndOverwritesPtr _defaultsAndOverwrites; // Immutable, not reset by destroy(). RouterManagerPtr _routerManager; ReferenceFactoryPtr _referenceFactory; ProxyFactoryPtr _proxyFactory; @@ -85,8 +86,6 @@ private: ObjectAdapterFactoryPtr _objectAdapterFactory; ThreadPoolPtr _clientThreadPool; ThreadPoolPtr _serverThreadPool; - std::string _defaultProtocol; // Immutable, not reset by destroy(). - std::string _defaultHost; // Immutable, not reset by destroy(). EndpointFactoryManagerPtr _endpointFactoryManager; ::Ice::PluginManagerPtr _pluginManager; diff --git a/cpp/src/Ice/Makefile b/cpp/src/Ice/Makefile index c4883d217a1..0d83e41a672 100644 --- a/cpp/src/Ice/Makefile +++ b/cpp/src/Ice/Makefile @@ -31,6 +31,7 @@ OBJS = Initialize.o \ Stream.o \ BuiltinSequences.o \ BasicStream.o \ + DefaultsAndOverwrites.o \ TraceLevels.o \ TraceUtil.o \ Instance.o \ diff --git a/cpp/src/Ice/ProtocolPluginFacade.cpp b/cpp/src/Ice/ProtocolPluginFacade.cpp index 74dddf7b955..857a8b80900 100644 --- a/cpp/src/Ice/ProtocolPluginFacade.cpp +++ b/cpp/src/Ice/ProtocolPluginFacade.cpp @@ -13,6 +13,7 @@ #include <Ice/EndpointFactoryManager.h> #include <Ice/TraceLevels.h> #include <Ice/Initialize.h> +#include <Ice/DefaultsAndOverwrites.h> using namespace std; using namespace Ice; @@ -41,7 +42,7 @@ IceInternal::ProtocolPluginFacade::getCommunicator() const string IceInternal::ProtocolPluginFacade::getDefaultHost() const { - return _instance->defaultHost(); + return _instance->defaultsAndOverwrites()->defaultHost; } int diff --git a/cpp/src/Ice/TcpEndpoint.cpp b/cpp/src/Ice/TcpEndpoint.cpp index 237fec807b8..55a9459e071 100644 --- a/cpp/src/Ice/TcpEndpoint.cpp +++ b/cpp/src/Ice/TcpEndpoint.cpp @@ -16,6 +16,7 @@ #include <Ice/BasicStream.h> #include <Ice/LocalException.h> #include <Ice/Instance.h> +#include <Ice/DefaultsAndOverwrites.h> using namespace std; using namespace Ice; @@ -113,7 +114,7 @@ IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& if (_host.empty()) { - const_cast<string&>(_host) = _instance->defaultHost(); + const_cast<string&>(_host) = _instance->defaultsAndOverwrites()->defaultHost; } } diff --git a/cpp/src/Ice/TraceLevels.cpp b/cpp/src/Ice/TraceLevels.cpp index 724319a0d12..3829a494f65 100644 --- a/cpp/src/Ice/TraceLevels.cpp +++ b/cpp/src/Ice/TraceLevels.cpp @@ -31,7 +31,3 @@ IceInternal::TraceLevels::TraceLevels(const PropertiesPtr& properties) : const_cast<int&>(protocol) = properties->getPropertyAsInt(keyBase + protocolCat); const_cast<int&>(retry) = properties->getPropertyAsInt(keyBase + retryCat); } - -IceInternal::TraceLevels::~TraceLevels() -{ -} diff --git a/cpp/src/Ice/TraceLevels.h b/cpp/src/Ice/TraceLevels.h index 3feeac3f291..ea2cec28fb9 100644 --- a/cpp/src/Ice/TraceLevels.h +++ b/cpp/src/Ice/TraceLevels.h @@ -23,7 +23,6 @@ class TraceLevels : public ::IceUtil::Shared public: TraceLevels(const ::Ice::PropertiesPtr&); - virtual ~TraceLevels(); const int network; const char* networkCat; diff --git a/cpp/src/Ice/UdpEndpoint.cpp b/cpp/src/Ice/UdpEndpoint.cpp index ad60651d8c8..66f8a8b89d9 100644 --- a/cpp/src/Ice/UdpEndpoint.cpp +++ b/cpp/src/Ice/UdpEndpoint.cpp @@ -14,6 +14,7 @@ #include <Ice/BasicStream.h> #include <Ice/LocalException.h> #include <Ice/Instance.h> +#include <Ice/DefaultsAndOverwrites.h> using namespace std; using namespace Ice; @@ -111,7 +112,7 @@ IceInternal::UdpEndpoint::UdpEndpoint(const InstancePtr& instance, const string& if (_host.empty()) { - const_cast<string&>(_host) = _instance->defaultHost(); + const_cast<string&>(_host) = _instance->defaultsAndOverwrites()->defaultHost; } } diff --git a/cpp/src/Ice/ice.dsp b/cpp/src/Ice/ice.dsp index 7cc574d2d51..5c58ac3ed84 100644 --- a/cpp/src/Ice/ice.dsp +++ b/cpp/src/Ice/ice.dsp @@ -320,6 +320,10 @@ SOURCE=.\TraceLevels.cpp # End Source File
# Begin Source File
+SOURCE=.\DefaultsAndOverwrites.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\TraceUtil.cpp
# End Source File
# Begin Source File
@@ -736,6 +740,14 @@ SOURCE=.\TraceLevelsF.h # End Source File
# Begin Source File
+SOURCE=.\DefaultsAndOverwrites.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DefaultsAndOverwritesF.h
+# End Source File
+# Begin Source File
+
SOURCE=.\TraceUtil.h
# End Source File
# Begin Source File
|