diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerUtil.cpp | 16 | ||||
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 68 | ||||
-rw-r--r-- | cpp/src/Ice/PluginManagerI.h | 6 |
4 files changed, 20 insertions, 76 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 6a56fdfa3bd..8a1e5f45405 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -1079,12 +1079,6 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[]) assert(pluginManagerImpl); pluginManagerImpl->loadPlugins(argc, argv); - LoggerPtr logger = pluginManagerImpl->getLogger(); - if(logger) - { - _initData.logger = logger; - } - // // Get default router and locator proxies. Don't move this // initialization before the plug-in initialization!!! The proxies diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp index e015980c6d0..d6a534401e5 100644 --- a/cpp/src/Ice/LoggerUtil.cpp +++ b/cpp/src/Ice/LoggerUtil.cpp @@ -154,28 +154,28 @@ Ice::operator<<(Trace& out, ios_base& (*val)(ios_base&)) return out; } -Ice::IceLoggerPlugin::IceLoggerPlugin(const CommunicatorPtr& communicator, - const LoggerPtr& logger) +Ice::LoggerPlugin::LoggerPlugin(const CommunicatorPtr& communicator, const LoggerPtr& logger) { if(communicator == 0) { throw PluginInitializationException(__FILE__, __LINE__, "Communicator cannot be null"); } - IceInternal::InstancePtr instance = IceInternal::getInstance(communicator); - - if(logger != 0) + if(logger == 0) { - instance->setLogger(logger); + throw PluginInitializationException(__FILE__, __LINE__, "Logger cannot be null"); } + + IceInternal::InstancePtr instance = IceInternal::getInstance(communicator); + instance->setLogger(logger); } void -Ice::IceLoggerPlugin::initialize() +Ice::LoggerPlugin::initialize() { } void -Ice::IceLoggerPlugin::destroy() +Ice::LoggerPlugin::destroy() { } diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index 5c685b6c3bd..36812c69ac5 100644 --- a/cpp/src/Ice/PluginManagerI.cpp +++ b/cpp/src/Ice/PluginManagerI.cpp @@ -22,7 +22,6 @@ using namespace IceInternal; const char * const Ice::PluginManagerI::_kindOfObject = "plugin"; typedef Ice::Plugin* (*PLUGIN_FACTORY)(const CommunicatorPtr&, const string&, const StringSeq&); -typedef Ice::Logger* (*LOGGER_FACTORY)(const CommunicatorPtr&, const StringSeq&); // DEPRECATED void Ice::PluginManagerI::initializePlugins() @@ -126,7 +125,6 @@ Ice::PluginManagerI::destroy() r->second = 0; } - _logger = 0; _communicator = 0; } @@ -252,13 +250,6 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) } } - // DEPRECATED - string loggerStr = properties->getProperty("Ice.LoggerPlugin"); - if(loggerStr.length() != 0) - { - loadPlugin("Logger", loggerStr, cmdArgs, true); - } - stringSeqToArgs(cmdArgs, argc, argv); // @@ -273,7 +264,7 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) } void -Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, StringSeq& cmdArgs, bool isLogger) +Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, StringSeq& cmdArgs) { assert(_communicator); @@ -341,57 +332,20 @@ Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, St // Invoke the factory function. No exceptions can be raised // by the factory function because it's declared extern "C". // - if(isLogger) + PLUGIN_FACTORY factory = (PLUGIN_FACTORY)sym; + plugin = factory(_communicator, name, args); + if(!plugin) { - // DEPRECATED - LOGGER_FACTORY factory = (LOGGER_FACTORY)sym; - _logger = factory(_communicator, args); - if(!_logger) - { - PluginInitializationException e(__FILE__, __LINE__); - ostringstream out; - out << "failure in entry point `" << entryPoint << "'"; - e.reason = out.str(); - throw e; - } + PluginInitializationException e(__FILE__, __LINE__); + ostringstream out; + out << "failure in entry point `" << entryPoint << "'"; + e.reason = out.str(); + throw e; } - else - { - PLUGIN_FACTORY factory = (PLUGIN_FACTORY)sym; - plugin = factory(_communicator, name, args); - if(!plugin) - { - PluginInitializationException e(__FILE__, __LINE__); - ostringstream out; - out << "failure in entry point `" << entryPoint << "'"; - e.reason = out.str(); - throw e; - } - if(name == "Logger") - { - LoggerPluginPtr loggerPlugin = dynamic_cast<LoggerPlugin*>(plugin.get()); - if(!loggerPlugin) - { - PluginInitializationException e(__FILE__, __LINE__); - ostringstream out; - out << "Ice.Plugin.Logger does not implement an Ice::LoggerPlugin"; - e.reason = out.str(); - throw e; - } - _logger = loggerPlugin->getLogger(); - } - - _plugins[name] = plugin; - _initOrder.push_back(plugin); - } + _plugins[name] = plugin; + _initOrder.push_back(plugin); _libraries->add(library); } -Ice::LoggerPtr -Ice::PluginManagerI::getLogger() const -{ - return _logger; -} - diff --git a/cpp/src/Ice/PluginManagerI.h b/cpp/src/Ice/PluginManagerI.h index fb4f6a528e5..ec715e6770d 100644 --- a/cpp/src/Ice/PluginManagerI.h +++ b/cpp/src/Ice/PluginManagerI.h @@ -13,7 +13,6 @@ #include <Ice/Plugin.h> #include <Ice/InstanceF.h> #include <Ice/CommunicatorF.h> -#include <Ice/LoggerF.h> #include <Ice/DynamicLibraryF.h> #include <Ice/BuiltinSequences.h> #include <IceUtil/Mutex.h> @@ -37,8 +36,7 @@ private: friend class IceInternal::Instance; void loadPlugins(int&, char*[]); - void loadPlugin(const std::string&, const std::string&, StringSeq&, bool = false); - LoggerPtr getLogger() const; + void loadPlugin(const std::string&, const std::string&, StringSeq&); CommunicatorPtr _communicator; IceInternal::DynamicLibraryListPtr _libraries; @@ -47,8 +45,6 @@ private: std::vector<PluginPtr> _initOrder; bool _initialized; static const char * const _kindOfObject; - - LoggerPtr _logger; }; } |