diff options
Diffstat (limited to 'CIAO/DAnCE/NodeApplication/Container_Impl.cpp')
-rw-r--r-- | CIAO/DAnCE/NodeApplication/Container_Impl.cpp | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/CIAO/DAnCE/NodeApplication/Container_Impl.cpp b/CIAO/DAnCE/NodeApplication/Container_Impl.cpp index 89cab7af662..42d834c2ba5 100644 --- a/CIAO/DAnCE/NodeApplication/Container_Impl.cpp +++ b/CIAO/DAnCE/NodeApplication/Container_Impl.cpp @@ -27,7 +27,6 @@ CIAO::Container_Impl::_default_POA (void) CORBA::Long CIAO::Container_Impl::init (const CORBA::PolicyList *policies) - ACE_THROW_SPEC ((CORBA::SystemException)) { CIAO_TRACE ("CIAO::Container_Impl::init"); // @@ Initialize container and create the internal container @@ -54,8 +53,7 @@ CIAO::Container_Impl::init (const CORBA::PolicyList *policies) CORBA::NO_MEMORY ()); } - return this->container_->init (0, - policies); + return this->container_->init (0, policies); } @@ -63,11 +61,6 @@ Deployment::ComponentInfos * CIAO::Container_Impl::install ( const ::Deployment::ContainerImplementationInfo & container_impl_info ) - ACE_THROW_SPEC ((CORBA::SystemException, - ::Deployment::UnknownImplId, - ::Deployment::ImplEntryPointNotFound, - ::Deployment::InstallationFailure, - ::Components::InvalidConfiguration)) { CIAO_TRACE ("CIAO::Container_Impl::install"); Deployment::ComponentInfos_var retv; @@ -85,9 +78,44 @@ CIAO::Container_Impl::install ( CORBA::ULong const len = impl_infos.length (); retv->length (len); + REC_POL_MAP rec_pol_map; for (CORBA::ULong i = 0; i < len; ++i) { + const CORBA::ULong cplen = impl_infos[i].component_config.length (); + for (CORBA::ULong cp_len = 0; cp_len < cplen; ++cp_len) + { + if (impl_infos[i].component_config[cp_len]. + value.type ()->kind () == CORBA::tk_string) + { + const char* policy_set_id; + ACE_CString receptacle_name; + ACE_CString instance_name; + impl_infos[i].component_config[cp_len].value >>= + policy_set_id; + bool result = this->configurator_.policy_exists ( + policy_set_id); + if (result == true) + { + receptacle_name = impl_infos[i].component_config[cp_len]. + name.in (); + instance_name = impl_infos[i]. + component_instance_name.in (); + receptacle_name += "_"; + receptacle_name += instance_name; + CORBA::PolicyList_var policies = + this->configurator_.find_policies_by_name ( + policy_set_id); + CORBA::PolicyList temp_policies (0); + if (policies != 0) + { + temp_policies = *policies; + } + rec_pol_map.bind (receptacle_name, temp_policies); + } + } + } + // Install home Components::CCMHome_var home = this->install_home (impl_infos[i]); @@ -99,8 +127,7 @@ CIAO::Container_Impl::install ( throw Deployment::InstallationFailure (); // Create component from home - Components::CCMObject_var comp = - kh->create_component (); + Components::CCMObject_var comp = kh->create_component (); if (CORBA::is_nil (comp.in ())) throw Deployment::InstallationFailure (); @@ -225,6 +252,7 @@ CIAO::Container_Impl::install ( std_configurator->set_configuration (comp_attributes); } } + this->container_->set_receptacle_policy_map (rec_pol_map); } catch (const CORBA::Exception& ex) { @@ -237,7 +265,6 @@ CIAO::Container_Impl::install ( ::Deployment::Properties * CIAO::Container_Impl::properties () - ACE_THROW_SPEC ((CORBA::SystemException)) { CIAO_TRACE ("CIAO::Container_Impl::properties"); ::Deployment::Properties *retval = 0; @@ -253,7 +280,6 @@ CIAO::Container_Impl::properties () ::Deployment::NodeApplication_ptr CIAO::Container_Impl::get_node_application () - ACE_THROW_SPEC ((CORBA::SystemException)) { CIAO_TRACE ("CIAO::Container_Impl::get_node_application"); return ::Deployment::NodeApplication::_duplicate (this->nodeapp_.in ()); @@ -262,11 +288,6 @@ CIAO::Container_Impl::get_node_application () ::Components::CCMHome_ptr CIAO::Container_Impl::install_home ( const ::Deployment::ComponentImplementationInfo & impl_info) - ACE_THROW_SPEC ((CORBA::SystemException, - Deployment::UnknownImplId, - Deployment::ImplEntryPointNotFound, - Deployment::InstallationFailure, - Components::InvalidConfiguration)) { CIAO_TRACE ("CIAO::Container_Impl::install_home"); if (CIAO::debug_level () > 9) @@ -308,8 +329,7 @@ CIAO::Container_Impl::install_home ( "error in binding home for component " "instance [%s] \n", impl_info.component_instance_name.in ())); - ACE_THROW_RETURN (Deployment::InstallationFailure (), - Components::CCMHome::_nil ()); + throw Deployment::InstallationFailure (); } //Note: If the return value will be discarded, it must be kept in a var or @@ -320,8 +340,6 @@ CIAO::Container_Impl::install_home ( void CIAO::Container_Impl::remove_home (const char * comp_ins_name) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) { CIAO_TRACE ("CIAO::Container_Impl::remove_home"); @@ -347,8 +365,6 @@ CIAO::Container_Impl::remove_home (const char * comp_ins_name) // Remove all homes and components void CIAO::Container_Impl::remove () - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) { CIAO_TRACE ("CIAO::Container_Impl::remove"); @@ -379,8 +395,6 @@ CIAO::Container_Impl::remove () void CIAO::Container_Impl::remove_components () - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) { CIAO_TRACE ("CIAO::Container_Impl::remove_components"); @@ -413,8 +427,6 @@ CIAO::Container_Impl::remove_components () // Below method is not used actually. void CIAO::Container_Impl::remove_component (const char * comp_ins_name) - ACE_THROW_SPEC ((CORBA::SystemException, - Components::RemoveFailure)) { CIAO_TRACE ("CIAO::Container_Impl::remove_component"); |