diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp')
-rw-r--r-- | TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp index 1075d2d217a..03e2f530251 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp @@ -6,27 +6,28 @@ #include "ace/SString.h" CIAO::NodeImplementationInfoHandler:: -NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan) : +NodeImplementationInfoHandler (const ::Deployment::DeploymentPlan & plan, + const Deployment::ComponentPlans & shared_components) : plan_ (plan), node_info_ (0), - containers_info_map_ (plan) + containers_info_map_ (plan, shared_components) { ACE_NEW (node_info_, ::Deployment::NodeImplementationInfo); this->populate_server_resource_def (); this->populate_container_impl_infos (); } -Deployment::NodeImplementationInfo * +Deployment::NodeImplementationInfo * CIAO::NodeImplementationInfoHandler::node_impl_info (void) const { Deployment::NodeImplementationInfo_var retv; - ACE_NEW_RETURN (retv, + ACE_NEW_RETURN (retv, Deployment::NodeImplementationInfo (this->node_info_.in ()), 0); return retv._retn (); } -void +void CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) { const CORBA::ULong instance_len = plan_.instance.length (); @@ -36,51 +37,51 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) // Iterate over the instance list to find whether any server resource // has been specified + // TODO: We shoud do some sanity check here, since all the component + // instance in this NodeApplication should have the same "server_resource_def" + // defined. Since currently we ignored this sanity check, then will allow + // users to specify some self-conflicting configuration in the descriptor. for (i = 0; i < instance_len; ++i) { - if (this->plan_.instance[i].deployedResource.length () != 0) + if (false && this->plan_.instance[i].deployedResource.length () != 0) { - target_resource_id = + target_resource_id = this->plan_.instance[i].deployedResource[0].resourceName.in (); - break; - } - } - if (i != instance_len) - { - // Some component instance has server resource usage defined, so we - // set the <nodeapp_config> field of the NodeImplementationInfo struct. - for (CORBA::ULong j = 0; j < this->plan_.infoProperty.length (); ++j) - { - CIAO::DAnCE::ServerResource *server_resource_def = 0; - this->plan_.infoProperty[j].value >>= server_resource_def; - - if (ACE_OS::strcmp ((*server_resource_def).Id, - target_resource_id) == 0) + // Some component instance has server resource usage defined, so we + // set the <nodeapp_config> field of the NodeImplementationInfo struct. + for (CORBA::ULong j = 0; j < this->plan_.infoProperty.length (); ++j) { - // Found the target server resource def, and store it. - this->node_info_->nodeapp_config.length (1); + CIAO::DAnCE::ServerResource *server_resource_def = 0; + this->plan_.infoProperty[j].value >>= server_resource_def; + + if (ACE_OS::strcmp ((*server_resource_def).Id, + target_resource_id) == 0) + { + // Found the target server resource def, and store it. + this->node_info_->nodeapp_config.length (1); - this->node_info_->nodeapp_config[0].name = - CORBA::string_dup ("CIAOServerResource"); + this->node_info_->nodeapp_config[0].name = + CORBA::string_dup ("CIAOServerResource"); - this->node_info_->nodeapp_config[0].value <<= - server_resource_def; - break; + this->node_info_->nodeapp_config[0].value <<= + *server_resource_def; + break; + } } } } } -void +void CIAO::NodeImplementationInfoHandler::populate_container_impl_infos (void) { - CORBA::ULong curr_len = + CORBA::ULong curr_len = this->containers_info_map_.containers_info ()->length (); ACE_UNUSED_ARG (curr_len); - + // assignment operation - this->node_info_->impl_infos = + this->node_info_->impl_infos = *(this->containers_info_map_.containers_info ()); } |