diff options
author | Marc Laukien <marc@zeroc.com> | 2001-10-14 20:18:37 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-10-14 20:18:37 +0000 |
commit | fee72a95cb1dd3e355d7389d2a056142253abd58 (patch) | |
tree | 471f2642ef2a312c8af9bcee9c61fbd23b2d7631 /cpp | |
parent | user exceptin factories (diff) | |
download | ice-fee72a95cb1dd3e355d7389d2a056142253abd58.tar.bz2 ice-fee72a95cb1dd3e355d7389d2a056142253abd58.tar.xz ice-fee72a95cb1dd3e355d7389d2a056142253abd58.zip |
fixes
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/doc/Properties.sgml | 17 | ||||
-rw-r--r-- | cpp/src/Ice/.depend | 2 | ||||
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Collector.cpp | 35 | ||||
-rw-r--r-- | cpp/src/Ice/Collector.h | 2 |
5 files changed, 41 insertions, 17 deletions
diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml index 49e36e1f706..df2ba5d6e1f 100644 --- a/cpp/doc/Properties.sgml +++ b/cpp/doc/Properties.sgml @@ -356,5 +356,22 @@ value of <literal>Ice.ProgramName</literal>. (Unix only.) </section> </section> +<section><title>Ice.WarnAboutServerExceptions</title> +<section><title>Synopsis</title> +<synopsis> +Ice.WarnAboutServerExceptions=<replaceable>num</replaceable> +</synopsis> +</section> +<section> +<title>Description</title> +<para> +If <replaceable>num</replaceable> is set to a value larger than zero, +servers print warning messages if they encounter an unexpected +exception while accepting connection requests from clients, or while +dispatching operation calls invoked by clients. +</para> +</section> +</section> + </section> diff --git a/cpp/src/Ice/.depend b/cpp/src/Ice/.depend index fbc295153ac..cb6aa847a3f 100644 --- a/cpp/src/Ice/.depend +++ b/cpp/src/Ice/.depend @@ -32,7 +32,7 @@ Outgoing.o: Outgoing.cpp ../../include/Ice/Outgoing.h ../../include/Ice/EmitterF Incoming.o: Incoming.cpp ../../include/Ice/Incoming.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/IceUtil/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/InstanceF.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/CommunicatorF.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ServantLocator.h ../../include/Ice/Object.h Direct.o: Direct.cpp ../../include/Ice/Direct.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Config.h ../../include/IceUtil/Config.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ReferenceF.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/CommunicatorF.h ../../include/Ice/ServantLocator.h ../Ice/Reference.h ../Ice/EndpointF.h ../../include/Ice/InstanceF.h ../../include/Ice/Object.h Emitter.o: Emitter.cpp ../Ice/Emitter.h ../../include/Ice/EmitterF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/ConnectorF.h ../Ice/ThreadPoolF.h ../Ice/EndpointF.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ServantFactoryManagerF.h ../Ice/UserExceptionFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/Logger.h ../Ice/TraceLevels.h ../Ice/TraceUtil.h ../Ice/Transceiver.h ../Ice/Connector.h ../Ice/ThreadPool.h ../Ice/Endpoint.h ../Ice/AcceptorF.h ../../include/Ice/Outgoing.h ../../include/Ice/ReferenceF.h ../Ice/Protocol.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h -Collector.o: Collector.cpp ../Ice/Collector.h ../../include/Ice/CollectorF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/AcceptorF.h ../Ice/ThreadPoolF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../Ice/EndpointF.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EmitterF.h ../Ice/ServantFactoryManagerF.h ../Ice/UserExceptionFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/Logger.h ../Ice/TraceUtil.h ../Ice/Transceiver.h ../Ice/Acceptor.h ../Ice/ThreadPool.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocatorF.h ../Ice/Endpoint.h ../Ice/ConnectorF.h ../../include/Ice/Incoming.h ../Ice/Protocol.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h +Collector.o: Collector.cpp ../Ice/Collector.h ../../include/Ice/CollectorF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/TransceiverF.h ../Ice/AcceptorF.h ../Ice/ThreadPoolF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../Ice/EndpointF.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EmitterF.h ../Ice/ServantFactoryManagerF.h ../Ice/UserExceptionFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/Logger.h ../../include/Ice/Properties.h ../Ice/TraceUtil.h ../Ice/Transceiver.h ../Ice/Acceptor.h ../Ice/ThreadPool.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocatorF.h ../Ice/Endpoint.h ../Ice/ConnectorF.h ../../include/Ice/Incoming.h ../Ice/Protocol.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h Network.o: Network.cpp ../Ice/Network.h ../../include/Ice/Config.h ../../include/IceUtil/Config.h ../../include/Ice/Exception.h ../../include/IceUtil/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/Ice/LocalObjectF.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ThreadPool.o: ThreadPool.cpp ../Ice/ThreadPool.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../Ice/ThreadPoolF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/EventHandlerF.h ../Ice/EventHandler.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Buffer.h ../Ice/Network.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObjectF.h ../../include/Ice/LocalObject.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EmitterF.h ../Ice/ServantFactoryManagerF.h ../Ice/UserExceptionFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h ../Ice/Protocol.h ../Ice/ObjectAdapterFactory.h ../Ice/ObjectAdapterI.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/CollectorF.h EventHandler.o: EventHandler.cpp ../Ice/EventHandler.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../Ice/EventHandlerF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/ThreadPoolF.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Buffer.h ../Ice/Instance.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObject.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EmitterF.h ../Ice/ServantFactoryManagerF.h ../Ice/UserExceptionFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 9ed6f60f00a..4973f7506c7 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -818,6 +818,7 @@ IceInternal::BasicStream::read(ObjectPtr& v, const char* type) { vector<string> classIds; read(classIds); + classIds.push_back("::Ice::Object"); for (vector<string>::const_iterator p = classIds.begin(); p != classIds.end(); ++p) { ServantFactoryPtr factory = _instance->servantFactoryManager()->find(*p); @@ -871,6 +872,7 @@ IceInternal::BasicStream::throwException(const char** typesBegin, const char** t { vector<string> exceptionIds; read(exceptionIds); + exceptionIds.push_back("::Ice::UserException"); for (vector<string>::const_iterator p = exceptionIds.begin(); p != exceptionIds.end(); ++p) { UserExceptionFactoryPtr factory = _instance->userExceptionFactoryManager()->find(*p); diff --git a/cpp/src/Ice/Collector.cpp b/cpp/src/Ice/Collector.cpp index a4775d19464..9313d044540 100644 --- a/cpp/src/Ice/Collector.cpp +++ b/cpp/src/Ice/Collector.cpp @@ -11,6 +11,7 @@ #include <Ice/Collector.h> #include <Ice/Instance.h> #include <Ice/Logger.h> +#include <Ice/Properties.h> #include <Ice/TraceUtil.h> #include <Ice/Transceiver.h> #include <Ice/Acceptor.h> @@ -337,6 +338,9 @@ IceInternal::Collector::Collector(const InstancePtr& instance, _responseCount(0), _state(StateHolding) { + _warnAboutExceptions = + atoi(_instance->properties()->getProperty("Ice.WarnAboutServerExceptions").c_str()) > 0 ? true : false; + _threadPool = _instance->threadPool(); } @@ -456,14 +460,12 @@ IceInternal::Collector::closeConnection() void IceInternal::Collector::warning(const LocalException& ex) const { -// TODO: Property to enable/disable the warnings below -/* - string s("server exception:\n"); - s += ex.toString(); - s += "\n"; - s += _transceiver->toString(); - _logger->warning(s); -*/ + if (_warnAboutExceptions) + { + ostringstream s; + s << "server exception:\n" << ex << '\n' << _transceiver->toString(); + _logger->warning(s.str()); + } } void @@ -607,6 +609,9 @@ IceInternal::CollectorFactory::CollectorFactory(const InstancePtr& instance, _logger(instance->logger()), _state(StateHolding) { + _warnAboutExceptions = + atoi(_instance->properties()->getProperty("Ice.WarnAboutServerExceptions").c_str()) > 0 ? true : false; + try { _transceiver = _endpoint->serverTransceiver(_instance, _endpoint); @@ -730,12 +735,10 @@ IceInternal::CollectorFactory::clearBacklog() void IceInternal::CollectorFactory::warning(const LocalException& ex) const { -// TODO: Property to enable/disable the warnings below -/* - string s("server exception:\n"); - s += ex.toString(); - s += "\n"; - s += _acceptor->toString(); - _logger->warning(s); -*/ + if (_warnAboutExceptions) + { + ostringstream s; + s << "server exception:\n" << ex << '\n' << _acceptor->toString(); + _logger->warning(s.str()); + } } diff --git a/cpp/src/Ice/Collector.h b/cpp/src/Ice/Collector.h index 0801abf3c1e..891afdccae8 100644 --- a/cpp/src/Ice/Collector.h +++ b/cpp/src/Ice/Collector.h @@ -91,6 +91,7 @@ private: ThreadPoolPtr _threadPool; int _responseCount; State _state; + bool _warnAboutExceptions; }; class CollectorFactory : public EventHandler, public JTCMutex @@ -142,6 +143,7 @@ private: ThreadPoolPtr _threadPool; std::list<CollectorPtr> _collectors; State _state; + bool _warnAboutExceptions; }; } |