diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-06-03 16:59:14 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2005-06-03 16:59:14 +0000 |
commit | 6c8c8c7d976dc98b7b258232724042d8037286cf (patch) | |
tree | c26ff548f2fb135ff74337156b57a3c461957c90 | |
parent | 642f44702419ebb6ae2220d9a61bce50b0daabd3 (diff) | |
download | ATCD-6c8c8c7d976dc98b7b258232724042d8037286cf.tar.gz |
*** empty log message ***
5 files changed, 58 insertions, 33 deletions
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp index 9aac35b30b6..c652a32a3d8 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp @@ -34,23 +34,10 @@ CIAO::Deployment_Configuration::init (const char *filename) char destination[NAME_BUFSIZE], ior[NAME_BUFSIZE]; - ACE_Hash_Map_Manager_Ex<ACE_CString, - int, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex> check_ior_duplication; - int first = 1; while (fscanf (inf, "%s %s", destination, ior ) != EOF) { - if (check_ior_duplication.bind (ior, 0) == 1) // duplication found - { - ACE_DEBUG ((LM_ERROR, "(%P|%t) IOR of NodeManagers should be unique, " - "check your node manager map file.\n")); - return -1; // indicate "init" failed. - } - this->deployment_info_.bind (destination, ior); if (first) diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 1998851bdf2..03682e53c42 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -5,7 +5,6 @@ #include "ace/Null_Mutex.h" #include "ace/OS_NS_string.h" #include "ace/SString.h" - //#include "Config_Handlers/DnC_Dump.h" #if !defined (__ACE_INLINE__) @@ -206,8 +205,15 @@ split_plan (void) ACE_NEW_RETURN (tmp_plan, ::Deployment::DeploymentPlan, 0); - - tmp_plan->UUID = CORBA::string_dup (this->plan_.UUID.in ()); + + // Construct the UUID for the child plan. + // Currently, this UUID consists of: + // The global UUID for the parent plan + the name of the node the + // child plan is to be installed on. + ACE_CString child_uuid (this->plan_.UUID.in ()); + child_uuid += this->node_manager_names_[i]; + + tmp_plan->UUID = CORBA::string_dup (child_uuid.c_str ()); tmp_plan->implementation.length (0); tmp_plan->instance.length (0); @@ -256,7 +262,7 @@ split_plan (void) // Get the child plan. ::Deployment::DeploymentPlan_var &child_plan = (entry->int_id_).child_plan_; - + // Fill in the contents of the child plan entry. // Append the "MonolithicDeploymentDescriptions implementation" @@ -266,9 +272,8 @@ split_plan (void) const ::Deployment::MonolithicDeploymentDescription & my_implementation = (this->plan_.implementation)[my_instance.implementationRef]; - //Deployment::DnC_Dump::dump (this->plan_); + // Deployment::DnC_Dump::dump (this->plan_); //Deployment::DnC_Dump::dump ( (this->plan_.implementation)[my_instance.implementationRef]); - //ACE_DEBUG ((LM_DEBUG, "My implementation")); //Deployment::DnC_Dump::dump (my_implementation); @@ -360,14 +365,14 @@ startLaunch (const ::Deployment::Properties & configProperty, ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; - + if (this->artifact_map_.find (this->node_manager_names_[i], entry) != 0) ACE_THROW (Deployment::StartError ()); // Should never happen! - + ::Deployment::NodeApplicationManager_ptr my_nam = (entry->int_id_).node_application_manager_.in (); - + if (CORBA::is_nil (my_nam)) { ACE_DEBUG ((LM_DEBUG, "While starting launch, the DomainApplicationManager\ @@ -661,9 +666,12 @@ destroyManager (ACE_ENV_SINGLE_ARG_DECL) ::Deployment::NodeManager_var my_node_manager = (entry->int_id_).node_manager_; - - // Since we have the first arg is not used by NM anyway. - my_node_manager->destroyManager (0 ACE_ENV_ARG_PARAMETER); + + ::Deployment::NodeApplicationManager_var my_nam = + (entry->int_id_).node_application_manager_; + + my_node_manager->destroyManager (my_nam.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } } diff --git a/TAO/CIAO/DAnCE/NodeManager/NAM_Map.cpp b/TAO/CIAO/DAnCE/NodeManager/NAM_Map.cpp index fa6388c5081..d14efc9829b 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NAM_Map.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NAM_Map.cpp @@ -44,11 +44,11 @@ namespace CIAO i != this->map_.end (); ++i) { - //if ( (*iter).int_id_ == oid + if ((*i).int_id_ == oid) + return this->map_.unbind ((*i).ext_id_) == 0; } return false; } - } diff --git a/TAO/CIAO/DAnCE/NodeManager/NAM_Map.h b/TAO/CIAO/DAnCE/NodeManager/NAM_Map.h index 099fbacdbd8..bb7fa5a59d7 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NAM_Map.h +++ b/TAO/CIAO/DAnCE/NodeManager/NAM_Map.h @@ -2,7 +2,8 @@ * @file NAM_Map.h * @author Will Otte <wotte@dre.vanderbilt.edu> * - * Map of NodeApplicationManagers + * Map of NodeApplicationManagers, inspired by the DAM_Map + * class. * * $Id$ */ @@ -58,9 +59,10 @@ namespace CIAO ACE_Equal_To<ACE_CString>, ACE_Null_Mutex> MAP; - typedef MAP::iterator Iterator; - + typedef MAP::iterator Iterator; + MAP map_; + }; } diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp index fea8a97a957..450fff89e76 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeDaemon_Impl.cpp @@ -104,6 +104,12 @@ CIAO::NodeDaemon_Impl::preparePlan (const Deployment::DeploymentPlan &plan { if (!this->map_.is_available (plan.UUID.in ())) { + if (CIAO::debug_level () > 10) + { + ACE_DEBUG ((LM_DEBUG, "NM:prepare_plan: " + "creating a new NAM with UUID: %s\n", + plan.UUID.in ())); + } //Implementation undefined. CIAO::NodeApplicationManager_Impl *app_mgr; @@ -139,6 +145,16 @@ CIAO::NodeDaemon_Impl::preparePlan (const Deployment::DeploymentPlan &plan } */ } + else + { + if (CIAO::debug_level () > 10) + { + ACE_DEBUG ((LM_DEBUG, "NM:prepare_plan: reusing an old NAM " + "with UUID: %s\n", + plan.UUID.in ())); + } + } + CORBA::Object_var obj = this->poa_->id_to_reference (this->map_.get_nam (plan.UUID.in ())); @@ -169,7 +185,7 @@ CIAO::NodeDaemon_Impl::destroyManager ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StopError, Deployment::InvalidReference)) -{ +{ ACE_TRY { // Deactivate this object @@ -177,12 +193,22 @@ CIAO::NodeDaemon_Impl::destroyManager this->poa_->reference_to_id (manager ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + + ACE_DEBUG ((LM_DEBUG, "After r_t_i\n")); + + if (!this->map_.remove_nam (id)) + { + ACE_ERROR ((LM_ERROR, + "NodeDaemon_Impl::destroyManager: " + "Unable to remove object from map!\n")); + } + this->poa_->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - this->map_.remove_nam (id); + ACE_DEBUG ((LM_DEBUG, "After d_o\n")); + } ACE_CATCH (PortableServer::POA::WrongAdapter, ex) { @@ -206,4 +232,6 @@ CIAO::NodeDaemon_Impl::destroyManager ACE_RE_THROW; } ACE_ENDTRY; + + } |