diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PluginManagerI.cpp | 56 | ||||
-rw-r--r-- | cpp/src/Ice/PluginManagerI.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 |
4 files changed, 25 insertions, 38 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp index cda7176581a..c89433e2e67 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&); void Ice::PluginManagerI::initializePlugins() @@ -203,7 +202,7 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) if(q != plugins.end()) { - loadPlugin(name, q->second, cmdArgs, false); + loadPlugin(name, q->second, cmdArgs); plugins.erase(q); } else @@ -239,7 +238,7 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) else if(suffix == "cpp") { name = name.substr(0, dotPos); - loadPlugin(name, p->second, cmdArgs, false); + loadPlugin(name, p->second, cmdArgs); plugins.erase(p); } else @@ -263,21 +262,11 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[]) p = q; } - loadPlugin(name, p->second, cmdArgs, false); + loadPlugin(name, p->second, cmdArgs); plugins.erase(p); } } - string loggerStr = properties->getProperty("Ice.LoggerPlugin.cpp"); - if(loggerStr.empty()) - { - loggerStr = properties->getProperty("Ice.LoggerPlugin"); - } - if(!loggerStr.empty()) - { - loadPlugin("Logger", loggerStr, cmdArgs, true); - } - stringSeqToArgs(cmdArgs, argc, argv); // @@ -292,7 +281,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); @@ -360,35 +349,34 @@ 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) { - 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 + + if(name == "Logger") { - PLUGIN_FACTORY factory = (PLUGIN_FACTORY)sym; - plugin = factory(_communicator, name, args); - if(!plugin) + LoggerPluginPtr loggerPlugin = dynamic_cast<LoggerPlugin*>(plugin.get()); + if(!loggerPlugin) { PluginInitializationException e(__FILE__, __LINE__); ostringstream out; - out << "failure in entry point `" << entryPoint << "'"; + out << "Ice.Plugin.Logger does not implement an Ice::LoggerPlugin"; e.reason = out.str(); throw e; } - - _plugins[name] = plugin; - _initOrder.push_back(plugin); + _logger = loggerPlugin->getLogger(); } + + _plugins[name] = plugin; + _initOrder.push_back(plugin); + _libraries->add(library); } diff --git a/cpp/src/Ice/PluginManagerI.h b/cpp/src/Ice/PluginManagerI.h index a826670152a..fff75e4c01e 100644 --- a/cpp/src/Ice/PluginManagerI.h +++ b/cpp/src/Ice/PluginManagerI.h @@ -37,7 +37,7 @@ private: friend class IceInternal::Instance; void loadPlugins(int&, char*[]); - void loadPlugin(const std::string&, const std::string&, StringSeq&, bool); + void loadPlugin(const std::string&, const std::string&, StringSeq&); LoggerPtr getLogger() const; CommunicatorPtr _communicator; diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index ab98aceb620..92d94b02ec2 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Aug 20 15:53:16 2007 +// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Aug 30 13:57:41 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -52,7 +52,6 @@ const IceInternal::Property IcePropsData[] = IceInternal::Property("Ice.GC.Interval", false, 0), IceInternal::Property("Ice.ImplicitContext", false, 0), IceInternal::Property("Ice.InitPlugins", false, 0), - IceInternal::Property("Ice.LoggerPlugin", false, 0), IceInternal::Property("Ice.MessageSizeMax", false, 0), IceInternal::Property("Ice.MonitorConnections", false, 0), IceInternal::Property("Ice.Nohup", false, 0), diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index a6c99f032d2..c4fae4b8cbd 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ./config/PropertyNames.xml, Mon Aug 20 15:53:16 2007 +// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Aug 30 13:57:41 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! |