diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-02-14 23:11:20 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-02-14 23:11:20 +0000 |
commit | c57d7fd322eaf5c1dbe8e2ce73cd7f0730ee8f6a (patch) | |
tree | 16c07bc79297be4df896231eb17c59111aca58a3 | |
parent | 3f471fc55e590e82ed998a30f670658281110bdb (diff) | |
download | ATCD-c57d7fd322eaf5c1dbe8e2ce73cd7f0730ee8f6a.tar.gz |
Tue Feb 14 23:01:46 UTC 2006 Gan Deng <gan.deng@vanderbilt.edu>
7 files changed, 82 insertions, 43 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 9527575153e..12d6fe4a72f 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,29 @@ +Tue Feb 14 23:01:46 UTC 2006 Gan Deng <gan.deng@vanderbilt.edu> + + * DAnCE/NodeApplication/NodeApplication_Impl.cpp + + Fixed a bug when removing ReDaC components from the container. + This bug was caused by the container set indexing error when + handling newly installed components. + Thanks Sandro Andrade <sandro @dcc.ufba.br> for reporting + this issue. + + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp + * DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp + + Some cosmetic changes. + + * DAnCE/NodeApplicationManager/ImplementationInfo.cpp + * DAnCE/NodeApplicationManager/ImplementationInfo.h + + Added a const modifier in the constructor to ensure safety. + + * DAnCE/NodeManager/NodeManager_Impl.cpp + + Fixed a bug when detecting whether a component is shared + by multiple assemblies. Earlier, when ReDaC is used, existing + components are wrongly treated as shared components. + Tue Feb 14 22:02:59 UTC 2006 William R. Otte <wotte@dre.vanderbilt.edu> * CIAO_TAO_DAnCE.mwc diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 729c5eab0ac..e978ffbbdcf 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -164,9 +164,6 @@ init (ACE_ENV_SINGLE_ARG_DECL) Chained_Artifacts & artifacts = entry->int_id_; - // The dump() function is broken. - //Deployment::DnC_Dump::dump (artifacts.child_plan_); - // Call preparePlan() method on the NodeManager with the // corresponding child plan as input, which returns a // NodeApplicationManager object reference. @@ -1003,7 +1000,7 @@ get_outgoing_connections (const Deployment::DeploymentPlan &plan, bool is_getting_all_connections, bool is_search_new_plan, Connection_Search_Type t - ACE_ENV_ARG_DECL) + ACE_ENV_ARG_DECL) { CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_outgoing_connections"); Deployment::Connections_var connections; @@ -1024,7 +1021,7 @@ get_outgoing_connections (const Deployment::DeploymentPlan &plan, connections.inout (), is_getting_all_connections, is_search_new_plan - ACE_ENV_ARG_PARAMETER)) + ACE_ENV_ARG_PARAMETER)) return 0; } return connections._retn (); @@ -1102,8 +1099,8 @@ get_outgoing_connections_i (const char * instname, // connections to get the objRef. const CORBA::ULong all_conn_len = this->all_connections_->length (); for (CORBA::ULong conn_index = 0; - conn_index < all_conn_len; - ++conn_index) + conn_index < all_conn_len; + ++conn_index) { const Deployment::Connection curr_rev_conn = this->all_connections_[conn_index]; @@ -1313,7 +1310,7 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) true, // yes, get *all* the connections true, // yes, we search the current plan DomainApplicationManager_Impl::External_Connections - ACE_ENV_ARG_PARAMETER); + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Invoke finishLaunch() on NodeApplication to remove bindings. diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index dc521a5d37f..1104e20cd41 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -42,8 +42,8 @@ CIAO::NodeApplication_Impl::create_all_containers ( // Build the Component_Container_Map for (CORBA::ULong j = 0; - j < container_infos[i].impl_infos.length (); - ++j) + j < container_infos[i].impl_infos.length (); + ++j) { this->component_container_map_.bind ( container_infos[i].impl_infos[j].component_instance_name.in (), @@ -447,6 +447,10 @@ CIAO::NodeApplication_Impl::install ( "CIAO::NodeApplication_Impl::install -" "creating all the containers. \n")); } + + + CORBA::ULong old_set_size = this->container_set_.size (); + (void) this->create_all_containers (container_infos); if (CIAO::debug_level () > 9) { @@ -464,8 +468,9 @@ CIAO::NodeApplication_Impl::install ( for (CORBA::ULong i = 0; i < num_containers; ++i) { Deployment::ComponentInfos_var comp_infos = - this->container_set_.at(i)->install (container_infos[i] - ACE_ENV_ARG_PARAMETER); + this->container_set_.at(i+old_set_size)-> + install (container_infos[i] + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Append the return sequence to the *big* return sequence @@ -573,7 +578,7 @@ CIAO::NodeApplication_Impl::remove (ACE_ENV_SINGLE_ARG_DECL) // Create a container interface, which will be hosted in this NodeApplication. ::Deployment::Container_ptr CIAO::NodeApplication_Impl::create_container ( - const ::Deployment::Properties &properties + const ::Deployment::Properties &properties ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, ::Components::CreateFailure, diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp index 40875a9571f..cca47f5b9dd 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.cpp @@ -6,8 +6,9 @@ #include "ace/SString.h" CIAO::NodeImplementationInfoHandler:: -NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components) : +NodeImplementationInfoHandler ( + const ::Deployment::DeploymentPlan & plan, + const Deployment::ComponentPlans & shared_components) : plan_ (plan), node_info_ (0), containers_info_map_ (plan, shared_components) @@ -17,17 +18,17 @@ NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan, 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 (); @@ -39,13 +40,13 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) // 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 + // 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) { - target_resource_id = + target_resource_id = this->plan_.instance[i].deployedResource[0].resourceName.in (); // Some component instance has server resource usage defined, so we @@ -55,16 +56,16 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) CIAO::DAnCE::ServerResource *server_resource_def = 0; this->plan_.infoProperty[j].value >>= server_resource_def; - if (ACE_OS::strcmp ((*server_resource_def).Id, + 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 = + this->node_info_->nodeapp_config[0].name = CORBA::string_dup ("CIAOServerResource"); - this->node_info_->nodeapp_config[0].value <<= + this->node_info_->nodeapp_config[0].value <<= *server_resource_def; break; } @@ -73,15 +74,15 @@ CIAO::NodeImplementationInfoHandler::populate_server_resource_def (void) } } -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 ()); } diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h index f0a103fdad5..475802f3d1a 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/ImplementationInfo.h @@ -37,8 +37,9 @@ namespace CIAO class CIAO_NAM_Export NodeImplementationInfoHandler { public: - NodeImplementationInfoHandler (::Deployment::DeploymentPlan & plan, - const Deployment::ComponentPlans & shared_components); + NodeImplementationInfoHandler ( + const ::Deployment::DeploymentPlan & plan, + const Deployment::ComponentPlans & shared_components); Deployment::NodeImplementationInfo * node_impl_info (void) const; diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index 4967a93e118..02bc4f6ba1f 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -363,7 +363,7 @@ perform_redeployment (const Deployment::Properties & configProperty, // // // (1) If this is an brand new NAM, then only new installation is needed. - // (2) Then we coudl pretty much clone the "startLaunch" implementation. + // (2) Then we could pretty much clone the "startLaunch" implementation. // This capability is useful to install a set of new components into // some totally new nodes. @@ -399,11 +399,11 @@ perform_redeployment (const Deployment::Properties & configProperty, else // This is a new NodeApplication process, then we need to install // all the components. We should try to reuse much of the above code. { - this->startLaunch (configProperty, - providedReference, - start - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->startLaunch (configProperty, + providedReference, + start + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; } } ACE_CATCH (Deployment::UnknownImplId, e) @@ -463,7 +463,7 @@ add_new_components () // package the components NodeImplementationInfoHandler handler (tmp_plan, - this->shared_components_); + this->shared_components_); Deployment::NodeImplementationInfo * node_info = handler.node_impl_info (); @@ -576,7 +576,7 @@ is_to_be_removed (const char * name) void CIAO::NodeApplicationManager_Impl_Base:: set_shared_components (const Deployment::ComponentPlans & shared - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((::CORBA::SystemException)) { this->shared_components_ = shared; diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp index db1c0883454..f657129ebf0 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp @@ -185,9 +185,11 @@ set_all_consumers (ACE_CString &name, this->comp_consumers_map_.rebind (name, consumers); } + Deployment::NodeApplicationManager_ptr -CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan - ACE_ENV_ARG_DECL) +CIAO::NodeManager_Impl_Base:: +preparePlan (const Deployment::DeploymentPlan &plan + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, Deployment::PlanError)) @@ -220,7 +222,15 @@ CIAO::NodeManager_Impl_Base::preparePlan (const Deployment::DeploymentPlan &plan } else { - // Increase the ref count by 1 + // If the instance is within the same deployment plan, e.g., + // when ReDaC service is used, then just do nothing since it is NOT + // actually a shared component at all. + if (ACE_OS::strcmp (plan.UUID.in (), + entry->int_id_.plan_uuid_.c_str ()) == 0) + continue; + + // Otherwise, it is really a shared component, so let's increase + // the ref count by 1 this->shared_components_.insert (plan.instance[i].name.in ()); ++ entry->int_id_.count_; } @@ -436,12 +446,11 @@ destroyPlan (const Deployment::DeploymentPlan & plan // Reset each NAM about the shared components information Deployment::ComponentPlans_var shared = this->get_shared_components_i (); - nam->set_shared_components (shared.inout ()); + nam->set_shared_components (shared.in ()); nam->destroyApplication (0); - - // The problem is that we should NOT actually kill the NA process if + // @@ The problem is that we should NOT actually kill the NA process if // there are some components that are shared by other plans. } |