From 3014bb2220d6403c97fe7b81a810ea433b6975c9 Mon Sep 17 00:00:00 2001 From: nanbor Date: Tue, 1 Nov 2005 21:10:57 +0000 Subject: ChangeLogTag:Tue Nov 01 13:44:58 2005 Nanbor Wang --- TAO/CIAO/ChangeLog | 9 +++++++++ TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp | 13 +++++++++++++ TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h | 6 ++++-- TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl | 3 +-- .../DAnCE/NodeApplication/RTNodeApp_Configurator.cpp | 20 +++++++++++++++++++- .../DAnCE/NodeApplication/RTNodeApp_Configurator.h | 3 +++ 6 files changed, 49 insertions(+), 5 deletions(-) (limited to 'TAO') diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index c770541dcb4..b75f9a4025d 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,12 @@ +Tue Nov 01 13:44:58 2005 Nanbor Wang + + * DAnCE/NodeApplication/RTConfig_Manager.cpp: + * DAnCE/NodeApplication/RTConfig_Manager.h: + * DAnCE/NodeApplication/RTConfig_Manager.inl: + * DAnCE/NodeApplication/RTNodeApp_Configurator.cpp: + * DAnCE/NodeApplication/RTNodeApp_Configurator.h: Integrated + RTConfig_Manager with the RTNodeApp_Configurator. + Mon Oct 31 22:37:42 2005 Nanbor Wang * DAnCE/NodeApplication/NodeApplication/NodeApplication.mpc: diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp index d4c02fe8653..64f7577a4ba 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.cpp @@ -8,12 +8,25 @@ # include "RTConfig_Manager.inl" #endif /* __ACE_INLINE__ */ +void +CIAO::RTResource_Config_Manager::init (RTCORBA::RTORB_ptr rtorb) +{ + this->rtorb_ = RTCORBA::RTORB::_duplicate (rtorb); +} + void CIAO::RTResource_Config_Manager::init_resources (const CIAO::DAnCE::ServerResource &server_resource ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { + if (CORBA::is_nil (this->rtorb_.in())) + { + ACE_DEBUG ((LM_DEBUG, + "RTResource_Config_Manager has not been properly initialized.\n")); + ACE_THROW (CORBA::INTERNAL ()); + } + const CIAO::DAnCE::ORBResource &orb_resource = server_resource.orb_config.orb_resources[0]; diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h index d2c8e86363e..ea39285b695 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h +++ b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.h @@ -50,8 +50,10 @@ namespace CIAO class RTResource_Config_Manager { public: - RTResource_Config_Manager (RTCORBA::RTORB_ptr rtorb); - ~RTResource_Config_Manager (); + RTResource_Config_Manager (void); + ~RTResource_Config_Manager (void); + + void init (RTCORBA::RTORB_ptr rtorb); /// Initializing the RTResource_Config_Manager void init_resources (const CIAO::DAnCE::ServerResource &info diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl index 7eca70be337..9537e7569ac 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl +++ b/TAO/CIAO/DAnCE/NodeApplication/RTConfig_Manager.inl @@ -1,8 +1,7 @@ // $Id$ ACE_INLINE -CIAO::RTResource_Config_Manager::RTResource_Config_Manager (RTCORBA::RTORB_ptr rtorb) - : rtorb_ (RTCORBA::RTORB::_duplicate (rtorb)) +CIAO::RTResource_Config_Manager::RTResource_Config_Manager () { } diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp index 5e240faa4ab..1f5f3f33ef3 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.cpp @@ -25,6 +25,8 @@ CIAO::RTNodeApp_Configurator::post_orb_initialize (CORBA::ORB_ptr o) this->rtorb_ = RTCORBA::RTORB::_narrow (object.in ()); + this->config_manager_.init (this->rtorb_.in ()); + return 0; } @@ -45,11 +47,15 @@ CIAO::RTNodeApp_Configurator::init_resource_manager if (ACE_OS::strcmp ("CIAOServerResources", properties[i].name) == 0) { - CIAO::DAnCE::ServerResource *svr_resource; + CIAO::DAnCE::ServerResource_var svr_resource; if (properties[i].value >>= svr_resource) { + this->config_manager_.init_resources (svr_resource); // Now we have the information to initialize the manager. } + else + ACE_ERROR_RETURN ((LM_ERROR, + "ERROR: RTNodeApp_Configurator::init_resource_manager unable to extract CIAOServerResources\n"), -1); } // Ignore other stuff @@ -69,6 +75,18 @@ CIAO::RTNodeApp_Configurator::find_container_policies { ACE_DEBUG ((LM_DEBUG, "RTNodeApp_Configurator::find_container_policies processing property: %s\n", properties[i].name.in ())); + + if (ACE_OS::strcmp ("ContainerPolicySet", properties[i].name) == 0) + { + const char *policy_name; + if (properties[i].value >>= policy_name) + { + return this->config_manager_.find_policies_by_name (policy_name); + } + else + ACE_ERROR_RETURN ((LM_ERROR, + "ERROR: RTNodeApp_Configurator::find_container_policies unable to extract ContainerPolicySet\n"), 0); + } } return 0; diff --git a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h index c150e94e372..37683d04956 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h +++ b/TAO/CIAO/DAnCE/NodeApplication/RTNodeApp_Configurator.h @@ -24,6 +24,7 @@ #include "NodeApp_Configurator.h" #include "RTNA_Configurator_Export.h" #include "tao/RTCORBA/RTCORBA.h" +#include "RTConfig_Manager.h" namespace CIAO { @@ -68,6 +69,8 @@ namespace CIAO CORBA::ORB_var orb_; RTCORBA::RTORB_var rtorb_; + + RTResource_Config_Manager config_manager_; }; } -- cgit v1.2.1