summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PluginManagerI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-08-23 10:33:05 -0400
committerBernard Normier <bernard@zeroc.com>2007-08-23 10:33:05 -0400
commit4170a1b8e1a134afd315a26eb65de1048f009e5c (patch)
tree1dce8f0e9c77bfb18486913aaef5bdd3e35cb580 /cpp/src/Ice/PluginManagerI.cpp
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2426 - logger date/time fo... (diff)
downloadice-4170a1b8e1a134afd315a26eb65de1048f009e5c.tar.bz2
ice-4170a1b8e1a134afd315a26eb65de1048f009e5c.tar.xz
ice-4170a1b8e1a134afd315a26eb65de1048f009e5c.zip
First cut
Diffstat (limited to 'cpp/src/Ice/PluginManagerI.cpp')
-rw-r--r--cpp/src/Ice/PluginManagerI.cpp70
1 files changed, 63 insertions, 7 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp
index 123c74c0be8..cda7176581a 100644
--- a/cpp/src/Ice/PluginManagerI.cpp
+++ b/cpp/src/Ice/PluginManagerI.cpp
@@ -152,7 +152,7 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[])
// with the prefix "Ice.Plugin.". These properties should
// have the following format:
//
- // Ice.Plugin.name=entry_point [args]
+ // Ice.Plugin.name[.<language>]=entry_point [args]
//
// If the Ice.PluginLoadOrder property is defined, load the
// specified plugins in the specified order, then load any
@@ -191,7 +191,16 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[])
throw ex;
}
- PropertyDict::iterator q = plugins.find("Ice.Plugin." + name);
+ PropertyDict::iterator q = plugins.find("Ice.Plugin." + name + ".cpp");
+ if(q == plugins.end())
+ {
+ q = plugins.find("Ice.Plugin." + name);
+ }
+ else
+ {
+ plugins.erase("Ice.Plugin." + name);
+ }
+
if(q != plugins.end())
{
loadPlugin(name, q->second, cmdArgs, false);
@@ -209,15 +218,62 @@ Ice::PluginManagerI::loadPlugins(int& argc, char* argv[])
//
// Load any remaining plugins that weren't specified in PluginLoadOrder.
//
- PropertyDict::const_iterator p;
- for(p = plugins.begin(); p != plugins.end(); ++p)
+
+ while(!plugins.empty())
{
+ PropertyDict::iterator p = plugins.begin();
+
string name = p->first.substr(prefix.size());
- loadPlugin(name, p->second, cmdArgs, false);
+
+ size_t dotPos = name.find_last_of('.');
+ if(dotPos != string::npos)
+ {
+ string suffix = name.substr(dotPos + 1);
+ if(suffix == "java" || suffix == "clr")
+ {
+ //
+ // Ignored
+ //
+ plugins.erase(p);
+ }
+ else if(suffix == "cpp")
+ {
+ name = name.substr(0, dotPos);
+ loadPlugin(name, p->second, cmdArgs, false);
+ plugins.erase(p);
+ }
+ else
+ {
+ //
+ // Name is just a regular name that happens to contain a dot
+ //
+ dotPos = string::npos;
+ }
+ }
+
+ if(dotPos == string::npos)
+ {
+ //
+ // Is there a .cpp entry?
+ //
+ PropertyDict::iterator q = plugins.find("Ice.Plugin." + name + ".cpp");
+ if(q != plugins.end())
+ {
+ plugins.erase(p);
+ p = q;
+ }
+
+ loadPlugin(name, p->second, cmdArgs, false);
+ plugins.erase(p);
+ }
}
- string loggerStr = properties->getProperty("Ice.LoggerPlugin");
- if(loggerStr.length() != 0)
+ string loggerStr = properties->getProperty("Ice.LoggerPlugin.cpp");
+ if(loggerStr.empty())
+ {
+ loggerStr = properties->getProperty("Ice.LoggerPlugin");
+ }
+ if(!loggerStr.empty())
{
loadPlugin("Logger", loggerStr, cmdArgs, true);
}