diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-02-23 11:59:40 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-02-23 11:59:40 +0000 |
commit | 5256229b83f41bd15335b5a11fa4cdfbb7cc7763 (patch) | |
tree | 653cf7c559170622ea76b64d208fbbb6d8807be4 | |
parent | f57decf0cb21148fd05ab92e1f7d2f8e3130423a (diff) | |
download | ATCD-5256229b83f41bd15335b5a11fa4cdfbb7cc7763.tar.gz |
Thu Feb 23 11:58:41 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* dance/DAnCE_Properties.idl:
* dance/LocalityManager/Daemon/Locality_Manager_Task.cpp:
* dance/LocalityManager/Handler/Config_Handler_Impl.cpp:
* dance/LocalityManager/Handler/Inst_Handler_Impl.cpp:
* dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp:
* dance/LocalityManager/Handler/Plugin_Conf.h:
* dance/LocalityManager/Handler/Plugin_Conf.cpp:
* dance/LocalityManager/Scheduler/Plugin_Manager.h:
* dance/LocalityManager/Scheduler/Plugin_Manager.cpp:
* docs/LocalityManager-Plugins.txt:
Added support for specify an additional open_mode for each dance
plugin. This open mode is than passed to ACE_DLL::open.
-rw-r--r-- | DAnCE/ChangeLog | 15 | ||||
-rw-r--r-- | DAnCE/dance/DAnCE_Properties.idl | 1 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Task.cpp | 6 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Handler/Config_Handler_Impl.cpp | 21 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp | 20 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp | 16 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Handler/Plugin_Conf.cpp | 28 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Handler/Plugin_Conf.h | 1 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.cpp | 32 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.h | 9 | ||||
-rw-r--r-- | DAnCE/docs/LocalityManager-Plugins.txt | 7 |
11 files changed, 120 insertions, 36 deletions
diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog index 65c49347098..962534661b2 100644 --- a/DAnCE/ChangeLog +++ b/DAnCE/ChangeLog @@ -1,3 +1,18 @@ +Thu Feb 23 11:58:41 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl> + + * dance/DAnCE_Properties.idl: + * dance/LocalityManager/Daemon/Locality_Manager_Task.cpp: + * dance/LocalityManager/Handler/Config_Handler_Impl.cpp: + * dance/LocalityManager/Handler/Inst_Handler_Impl.cpp: + * dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp: + * dance/LocalityManager/Handler/Plugin_Conf.h: + * dance/LocalityManager/Handler/Plugin_Conf.cpp: + * dance/LocalityManager/Scheduler/Plugin_Manager.h: + * dance/LocalityManager/Scheduler/Plugin_Manager.cpp: + * docs/LocalityManager-Plugins.txt: + Added support for specify an additional open_mode for each dance + plugin. This open mode is than passed to ACE_DLL::open. + Fri Jan 27 09:02:30 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl> * NEWS: diff --git a/DAnCE/dance/DAnCE_Properties.idl b/DAnCE/dance/DAnCE_Properties.idl index 392f295de96..0cd618aa3c7 100644 --- a/DAnCE/dance/DAnCE_Properties.idl +++ b/DAnCE/dance/DAnCE_Properties.idl @@ -96,6 +96,7 @@ module DAnCE /// Instance types that must be installed before the instance handled by the decorated handler const string DANCE_PLUGIN_ENTRYPT = "edu.vanderbilt.dre.DAnCE.InstanceHandler.EntryPoint"; const string DANCE_PLUGIN_ARTIFACT = "edu.vanderbilt.dre.DAnCE.InstanceHandler.Artifact"; + const string DANCE_PLUGIN_OPENMODE = "edu.vanderbilt.dre.DAnCE.InstanceHandler.OpenMode"; const string DANCE_IDH_DEPENDSON = "edu.vanderbilt.dre.DAnCE.InstanceHandler.DependsOn"; }; diff --git a/DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Task.cpp b/DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Task.cpp index 2a4fad9f612..05df7a9ab48 100644 --- a/DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Task.cpp +++ b/DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Task.cpp @@ -77,9 +77,9 @@ namespace DAnCE DAnCE::LocalityManager_i *lm_srv = 0; ACE_NEW_NORETURN (lm_srv, LocalityManager_i (this->uuid_, - this->plugin_config_, - this->orb_.in (), - root_poa.in ())); + this->plugin_config_, + this->orb_.in (), + root_poa.in ())); if (lm_srv == 0) { diff --git a/DAnCE/dance/LocalityManager/Handler/Config_Handler_Impl.cpp b/DAnCE/dance/LocalityManager/Handler/Config_Handler_Impl.cpp index 94c5e26af7b..a38499eed70 100644 --- a/DAnCE/dance/LocalityManager/Handler/Config_Handler_Impl.cpp +++ b/DAnCE/dance/LocalityManager/Handler/Config_Handler_Impl.cpp @@ -128,8 +128,22 @@ namespace DAnCE "No artifact found for plug-in initialization\n"); } + int open_mode = ACE_DEFAULT_SHLIB_MODE; + if (!DAnCE::Utility::get_property_value (DAnCE::DANCE_PLUGIN_OPENMODE, + mdd.execParameter, + open_mode)) + { + DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, + (LM_ERROR, DLINFO + ACE_TEXT ("Config_Handler_Impl::install_instance - ") + ACE_TEXT ("No open mode found for plug-in initialization\n"))); + throw ::Deployment::StartError (idd.name.in (), + "No open mode found for plug-in initialization\n"); + } + PLUGIN_MANAGER::instance ()->register_configuration_plugin (ACE_TEXT_CHAR_TO_TCHAR (artifact), - ACE_TEXT_CHAR_TO_TCHAR (entrypt)); + ACE_TEXT_CHAR_TO_TCHAR (entrypt), + open_mode); } void @@ -155,12 +169,11 @@ namespace DAnCE } void - Config_Handler_Impl::configure (const ::Deployment::Properties &prop ) + Config_Handler_Impl::configure (const ::Deployment::Properties &prop) { ::DAnCE::Utility::PROPERTY_MAP pmap (prop.length ()); - ::DAnCE::Utility::build_property_map (pmap, - prop); + ::DAnCE::Utility::build_property_map (pmap, prop); } } diff --git a/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp b/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp index e5a0584240b..a18c321451a 100644 --- a/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp +++ b/DAnCE/dance/LocalityManager/Handler/Inst_Handler_Impl.cpp @@ -46,7 +46,6 @@ namespace DAnCE void Inst_Handler_Impl::close (void) { - } char * Inst_Handler_Impl::instance_type (void) @@ -128,6 +127,19 @@ namespace DAnCE "No artifact found for plug-in initialization\n"); } + int open_mode = ACE_DEFAULT_SHLIB_MODE; + if (!DAnCE::Utility::get_property_value (DAnCE::DANCE_PLUGIN_OPENMODE, + mdd.execParameter, + open_mode)) + { + DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, + (LM_ERROR, DLINFO + ACE_TEXT ("Inst_Handler_Impl::install_instance - ") + ACE_TEXT ("No open mode found for plug-in initialization\n"))); + throw ::Deployment::StartError (idd.name.in (), + "No open mode found for plug-in initialization\n"); + } + Plugin_Manager::IH_DEPS deps; for (CORBA::ULong i = 0; i < idd.configProperty.length (); ++i) @@ -156,7 +168,8 @@ namespace DAnCE CORBA::String_var plugin_id = PLUGIN_MANAGER::instance ()->register_installation_handler (ACE_TEXT_CHAR_TO_TCHAR (artifact), ACE_TEXT_CHAR_TO_TCHAR (entrypt), - deps); + deps, + open_mode); (*outany) <<= CORBA::Any::from_string (plugin_id.in (), 0); } @@ -188,8 +201,7 @@ namespace DAnCE { ::DAnCE::Utility::PROPERTY_MAP pmap (prop.length ()); - ::DAnCE::Utility::build_property_map (pmap, - prop); + ::DAnCE::Utility::build_property_map (pmap, prop); } } diff --git a/DAnCE/dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp b/DAnCE/dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp index c824d9db909..2cd47d833ba 100644 --- a/DAnCE/dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp +++ b/DAnCE/dance/LocalityManager/Handler/Interceptor_Handler_Impl.cpp @@ -128,8 +128,22 @@ namespace DAnCE "No artifact found for plug-in initialization\n"); } + int open_mode = ACE_DEFAULT_SHLIB_MODE; + if (!DAnCE::Utility::get_property_value (DAnCE::DANCE_PLUGIN_OPENMODE, + mdd.execParameter, + open_mode)) + { + DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, + (LM_ERROR, DLINFO + ACE_TEXT ("Interceptor_Handler_Impl::install_instance - ") + ACE_TEXT ("No open mode found for plug-in initialization\n"))); + throw ::Deployment::StartError (idd.name.in (), + "No open mode found for plug-in initialization\n"); + } + PLUGIN_MANAGER::instance ()->register_interceptor (ACE_TEXT_CHAR_TO_TCHAR (artifact), - ACE_TEXT_CHAR_TO_TCHAR (entrypt)); + ACE_TEXT_CHAR_TO_TCHAR (entrypt), + open_mode); } void diff --git a/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.cpp b/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.cpp index 78d48b38246..c1fd1453e83 100644 --- a/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.cpp +++ b/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.cpp @@ -61,31 +61,39 @@ namespace DAnCE std::istream_iterator <std::string > (), std::back_inserter < std::vector < std::string > > (tokens)); - if (tokens.size () != 3) + if (tokens.size () < 3 || tokens.size () > 4) { DANCE_ERROR (DANCE_LOG_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Plugin_Configurator::load_from_text_file - ") - ACE_TEXT ("Skipping line <%C>, wrong format. Got %u tokens instead of 3\n"), + ACE_TEXT ("Skipping line <%C>, wrong format. Got %u tokens instead of 3 or 4\n"), string, tokens.size ())); } else { + int open_mode = ACE_DEFAULT_SHLIB_MODE; + DANCE_DEBUG (DANCE_LOG_EVENT_TRACE, (LM_DEBUG, DLINFO ACE_TEXT ("Plugin_Configurator::load_from_text_file - ") - ACE_TEXT ("Attempting to load plugin of type <%C>, artifact <%C>, entrypoint <%C>\n"), + ACE_TEXT ("Attempting to load plugin of type <%C>, artifact <%C>, entrypoint <%C>, open_mode <%C>\n"), tokens[0].c_str (), tokens[1].c_str (), - tokens[2].c_str ())); + tokens[2].c_str (), + tokens.size () == 4 ? tokens[3].c_str() : 0)); + if (tokens.size() == 4) + { + open_mode = ACE_OS::atoi (tokens[3].c_str()); + } if (ACE_OS::strcmp (tokens[0].c_str (), DAnCE::DANCE_INSTALLATIONHANDLER) == 0) { this->create_entry (tokens[1].c_str (), tokens[2].c_str (), DAnCE::DANCE_INSTALLATIONHANDLER, + open_mode, plan, pos++); } else if (ACE_OS::strcmp (tokens[0].c_str (), @@ -93,6 +101,7 @@ namespace DAnCE { this->create_entry (tokens[1].c_str (), tokens[2].c_str (), DAnCE::DANCE_DEPLOYMENTINTERCEPTOR, + open_mode, plan, pos++); } else if (ACE_OS::strcmp (tokens[0].c_str (), @@ -100,6 +109,7 @@ namespace DAnCE { this->create_entry (tokens[1].c_str (), tokens[2].c_str (), DAnCE::DANCE_CONFIGPLUGIN, + open_mode, plan, pos++); } else @@ -181,6 +191,7 @@ namespace DAnCE Plugin_Configurator::create_entry (const char *artifact, const char *entrypoint, const char *type, + int open_mode, ::Deployment::DeploymentPlan &plan, CORBA::ULong pos) { @@ -188,7 +199,7 @@ namespace DAnCE plan.implementation.length (pos + 1); plan.implementation[pos].name = artifact; - plan.implementation[pos].execParameter.length (3); + plan.implementation[pos].execParameter.length (4); plan.implementation[pos].execParameter[0].name = DAnCE::DANCE_PLUGIN_ARTIFACT; plan.implementation[pos].execParameter[0].value <<= @@ -198,8 +209,11 @@ namespace DAnCE plan.implementation[pos].execParameter[1].value <<= CORBA::Any::from_string (entrypoint, 0); - plan.implementation[pos].execParameter[2].name = DAnCE::IMPL_TYPE; - plan.implementation[pos].execParameter[2].value <<= + plan.implementation[pos].execParameter[2].name = DAnCE::DANCE_PLUGIN_OPENMODE; + plan.implementation[pos].execParameter[2].value <<= open_mode; + + plan.implementation[pos].execParameter[3].name = DAnCE::IMPL_TYPE; + plan.implementation[pos].execParameter[3].value <<= CORBA::Any::from_string (type, 0); plan.instance.length (pos + 1); diff --git a/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.h b/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.h index c379bf7e8f4..b33fe3ee42a 100644 --- a/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.h +++ b/DAnCE/dance/LocalityManager/Handler/Plugin_Conf.h @@ -25,6 +25,7 @@ namespace DAnCE void create_entry (const char *artifact, const char *entrypoint, const char *type, + int open_mode, ::Deployment::DeploymentPlan &plan, CORBA::ULong pos); }; diff --git a/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.cpp b/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.cpp index 86eb749cd5c..b37081166f7 100644 --- a/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.cpp +++ b/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.cpp @@ -13,14 +13,15 @@ namespace DAnCE template <typename PLUGIN> typename PLUGIN::_ptr_type load_plugin (const ACE_TCHAR *artifact, - const ACE_TCHAR *entrypoint) + const ACE_TCHAR *entrypoint, + int open_mode) { if (!artifact || !entrypoint) { DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Plugin_Manager::load_plugin - ") - ACE_TEXT ("Must provide non-nill artifact and entrypoint names\n"))); + ACE_TEXT ("Must provide non-nil artifact and entrypoint names\n"))); throw ::Deployment::PlanError ("", "Invalid parameters for plug-in installation"); } @@ -35,7 +36,7 @@ namespace DAnCE ACE_DLL plugin_dll; if (plugin_dll.open (artifact, - ACE_DEFAULT_SHLIB_MODE, + open_mode, false) != 0) { const ACE_TCHAR *error = plugin_dll.error (); @@ -43,8 +44,9 @@ namespace DAnCE DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Plugin_Manager::load_plugin - ") - ACE_TEXT ("Error while loading artifact <%s>: %s\n"), + ACE_TEXT ("Error while loading artifact <%s> with mode <%d>: %s\n"), artifact, + open_mode, error)); throw ::Deployment::PlanError (ACE_TEXT_ALWAYS_CHAR (artifact), @@ -92,11 +94,11 @@ namespace DAnCE DANCE_DEBUG (DANCE_LOG_MINOR_EVENT, (LM_TRACE, DLINFO ACE_TEXT ("Plugin_Manager::load_plugin - ") - ACE_TEXT ("Successfully created plugin from <%s>:<%s>.\n"), + ACE_TEXT ("Successfully created plugin from <%s> with mode <%d>:<%s>.\n"), artifact, + open_mode, entrypoint)); - return plugin._retn (); } } @@ -158,11 +160,13 @@ namespace DAnCE char * Plugin_Manager::register_installation_handler (const ACE_TCHAR *artifact, const ACE_TCHAR *entrypoint, - const Plugin_Manager::IH_DEPS &depends) + const Plugin_Manager::IH_DEPS &depends, + int open_mode) { ::DAnCE::InstanceDeploymentHandler_var plugin = load_plugin< ::DAnCE::InstanceDeploymentHandler > (artifact, - entrypoint); + entrypoint, + open_mode); try { @@ -226,12 +230,14 @@ namespace DAnCE void Plugin_Manager::register_interceptor (const ACE_TCHAR *artifact, - const ACE_TCHAR *entrypoint) + const ACE_TCHAR *entrypoint, + int open_mode) { ::DAnCE::DeploymentInterceptor_var plugin = load_plugin< ::DAnCE::DeploymentInterceptor > (artifact, - entrypoint); + entrypoint, + open_mode); try { plugin->configure (*this->config_); @@ -301,11 +307,13 @@ namespace DAnCE void Plugin_Manager::register_configuration_plugin (const ACE_TCHAR *artifact, - const ACE_TCHAR *entrypoint) + const ACE_TCHAR *entrypoint, + int open_mode) { DAnCE::LocalityConfiguration_var plugin = load_plugin< DAnCE::LocalityConfiguration > (artifact, - entrypoint); + entrypoint, + open_mode); try { diff --git a/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.h b/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.h index 7db45a4bf35..54090e0846e 100644 --- a/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.h +++ b/DAnCE/dance/LocalityManager/Scheduler/Plugin_Manager.h @@ -48,11 +48,13 @@ namespace DAnCE /// Registers a new installation handler. char * register_installation_handler (const ACE_TCHAR *artifact, const ACE_TCHAR *entrypoint, - const IH_DEPS &dependencies); + const IH_DEPS &dependencies, + int open_mode); /// Registers a new deployment interceptor void register_interceptor (const ACE_TCHAR *artifact, - const ACE_TCHAR *entrypoint); + const ACE_TCHAR *entrypoint, + int open_mode); typedef Dependency_Sorter::Invalid_Install_Order Invalid_Install_Order; @@ -69,7 +71,8 @@ namespace DAnCE const INTERCEPTORS & fetch_interceptors (void); void register_configuration_plugin (const ACE_TCHAR *artifact, - const ACE_TCHAR *entrypoint); + const ACE_TCHAR *entrypoint, + int open_mode); ::DAnCE::LocalityConfiguration_ptr get_configuration_handler (const char *id); diff --git a/DAnCE/docs/LocalityManager-Plugins.txt b/DAnCE/docs/LocalityManager-Plugins.txt index 600471c9f76..1fba66b7bee 100644 --- a/DAnCE/docs/LocalityManager-Plugins.txt +++ b/DAnCE/docs/LocalityManager-Plugins.txt @@ -60,7 +60,7 @@ DANCE_ROOT/bin/ciao.localityconfig The file format should be fairly self explanatory, but for a brief reference, it expects lines in the following format: -<plug-in instance type> <artifact name> <artifact entrypoint> +<plug-in instance type> <artifact name> <artifact entrypoint> <open_mode> e.g.: @@ -88,10 +88,13 @@ command line option --locality-config on the node manager). (1) will apply only to an individual locality instance, (2) will apply to ALL locality instances spawned by the node manager. +The open_mode is the mode as passed to the ACE_DLL::open call. When not +specified we default to ACE_DEFAULT_SHLIB_MODE + The dance_node_manager currently loads plug-ins by default from the nodemanager.localityconfig file, which contains the following: . Locality Manager installation handler -. Standard effor handling interceptor +. Standard effort handling interceptor Best effort deployment semantics are requested for the locality manager by supplying the following line in the localityconfig file in |