diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-01-21 02:58:53 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-01-21 02:58:53 +0000 |
commit | 22bce287f26bae7e1b7b45c5feac89bdc93ebc25 (patch) | |
tree | 0934c11f6298b53e03f6b82318574a85cd5f9919 | |
parent | a9f6172a5433153779a9c87fd7a797b963fcc294 (diff) | |
download | ATCD-22bce287f26bae7e1b7b45c5feac89bdc93ebc25.tar.gz |
*** empty log message ***
12 files changed, 382 insertions, 46 deletions
diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 3d989ddbc26..b6560c1b924 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -14,12 +14,14 @@ CIAO::DomainApplicationManager_Impl:: DomainApplicationManager_Impl (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, Deployment::TargetManager_ptr manager, + Execution_Manager::Execution_Manager_Impl * em, const Deployment::DeploymentPlan & plan, const char * deployment_file) ACE_THROW_SPEC ((CORBA::SystemException)) : orb_ (CORBA::ORB::_duplicate (orb)), poa_ (PortableServer::POA::_duplicate (poa)), - target_manager_ (Deployment::TargetManager::_duplicate (manager)), + target_manager_ (Deployment::TargetManager::_duplicate (manager)), // object ref + execution_manager_ (em), // a plain C++ pointer plan_ (plan), num_child_plans_ (0), // @@ (OO) The default size for an ACE_Hash_Map_Mapanger is quiet @@ -50,6 +52,32 @@ CIAO::DomainApplicationManager_Impl::~DomainApplicationManager_Impl () } } +Deployment::NodeApplication_ptr +CIAO::DomainApplicationManager_Impl:: +get_node_app (const char * node_name) + ACE_THROW_SPEC ((::CORBA::SystemException, + ::Deployment::NoSuchName)) +{ + // Get the NodeApplication object reference. + ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry; + + if (this->artifact_map_.find (node_name, + entry) != 0) + { + ACE_ERROR ((LM_ERROR, + "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" + "CIAO::DomainApplicationManager_Impl::get_node_app -" + "ERROR while finding the node application " + "for the node [%s] \n", + node_name)); + ACE_THROW (Deployment::NoSuchName ()); + } + + return + Deployment::NodeApplication::_duplicate ( + entry->int_id_.node_application_.in ()); +} + void CIAO::DomainApplicationManager_Impl:: init (ACE_ENV_SINGLE_ARG_DECL) @@ -300,6 +328,7 @@ split_plan (void) // 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 += "@"; child_uuid += this->node_manager_names_[i]; tmp_plan->UUID = CORBA::string_dup (child_uuid.c_str ()); @@ -563,9 +592,9 @@ startLaunch (const ::Deployment::Properties & configProperty, this->node_manager_names_[i].c_str ())); ACE_CString error - ("The DomainApplicationManager receives a nil\ - reference of NodeApplication after calling\ - startLaunch on NodeApplicationManager.\n"); + ("The DomainApplicationManager receives a nil " + "reference of NodeApplication after calling " + "startLaunch on NodeApplicationManager.\n"); ACE_ERROR ((LM_ERROR, error.c_str ())); ACE_TRY_THROW @@ -606,6 +635,10 @@ finishLaunch (CORBA::Boolean start, ACE_TRY { // Invoke finishLaunch() operation on each cached NodeApplication object. + // This will establish bindings for only those internal components, but + // NOT for those external/shared components, which requires special + // handle, since these components are outside the control of this + // DomainApplicationManager. for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) { // Get the NodeApplication object reference. @@ -690,7 +723,7 @@ finishLaunch (CORBA::Boolean start, entry->int_id_.node_application_->finishLaunch (*my_connections, start, - false // "false" => establish new connections only + true // "true" => establish new connections only ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -746,12 +779,15 @@ finishLaunch (CORBA::Boolean start, entry->int_id_.node_application_->finishLaunch (*unnecessary_connections, start, - true // true ==> remove unnecessary connections + false // false ==> remove unnecessary connections ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } } } + + // Establish bindings on external/shared components of this deployment plan. + this->post_finishLaunch (); } ACE_CATCHANY { @@ -785,6 +821,89 @@ finishLaunch (CORBA::Boolean start, ACE_CHECK; } +void +CIAO::DomainApplicationManager_Impl:: +post_finishLaunch (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)) +{ + ACE_TRY + { + for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) + { + // Get the shared components from all the NodeManagers + ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; + this->artifact_map_.find (this->node_manager_names_[i],entry); + + ::Deployment::NodeManager_ptr + my_node_manager = (entry->int_id_).node_manager_.in (); + + CORBA::StringSeq_var + shared = my_node_manager->get_shared_components (); + + // Invoke <finalize_global_binding> on ExecutionManager + CORBA::ULong length = shared->length (); + for (CORBA::ULong j = 0; j < length; ++j) + { + // Construct <Component_Binding_Info> struct for the component + Execution_Manager::Execution_Manager_Impl:: + Component_Binding_Info * binding; + + binding = this->populate_binding_info (shared[j].in (), + ""); + + this->execution_manager_->finalize_global_binding ( + *binding, true); + + delete binding; + } + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "DomainApplicationManager_Impl::post_finishLaunch.\n"); + ACE_RE_THROW; + } + ACE_ENDTRY; + + ACE_CHECK; +} + +CIAO::Execution_Manager::Execution_Manager_Impl::Component_Binding_Info * +CIAO::DomainApplicationManager_Impl:: +populate_binding_info (const char * name, const char * child_uuid) +{ + Execution_Manager::Execution_Manager_Impl::Component_Binding_Info * retv; + ACE_NEW_RETURN (retv, + Execution_Manager::Execution_Manager_Impl::Component_Binding_Info (), + 0); + + retv->name_ = name; + + // @@TODO: Finish the parsing up... + + // Parse the child_uuid string and populate the "node" name as well as the + // parent plan uuid + //retv.node_ = + //retv.plan_uuid_ = + + Deployment::Connections_var connections; + ACE_NEW_RETURN (connections, + Deployment::Connections, + 0); + + this->get_outgoing_connections_i (name, + connections.inout (), + false, // get *all* connections + true); // search current plan + + retv->providedReference_ = connections._retn (); + + return retv; +} + + Deployment::Connections * CIAO::DomainApplicationManager_Impl:: get_outgoing_connections (const Deployment::DeploymentPlan &plan, @@ -1103,7 +1222,7 @@ destroyApplication (ACE_ENV_SINGLE_ARG_DECL) entry->int_id_.node_application_->finishLaunch (*my_connections, start, - true // "true" => remove new connections only + false // "false" => remove new connections only ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h index ba132c11a91..0848599ea97 100644 --- a/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.h @@ -35,6 +35,7 @@ #include "Deployment_Configuration.h" #include "DomainApplicationManager_Export.h" +#include "../ExecutionManager/Execution_Manager_Impl.h" #include "ciao/CIAO_common.h" namespace CIAO @@ -69,6 +70,7 @@ namespace CIAO DomainApplicationManager_Impl (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, Deployment::TargetManager_ptr manager, + Execution_Manager::Execution_Manager_Impl * em, const Deployment::DeploymentPlan &plan, const char * deployment_file) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -80,6 +82,8 @@ namespace CIAO *============================================================*/ /** * Initialize the DomainApplicationManager. + * @para em A pointer to the ExecutionManager servant C++ object. + * * (1) Set the total number of child plans. * (2) Set the list of NodeManager names, which is an array of strings. * The <node_manager_names> is a pointer to an array of ACE_CString @@ -116,6 +120,16 @@ namespace CIAO *============================================================*/ /** + * Fetch the NodeApplication object reference based on the NodeManager name. + */ + virtual Deployment::NodeApplication_ptr get_node_app ( + const char * node_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Deployment::NoSuchName)); + + /** * Executes the application, but does not start it yet. Users can * optionally provide launch-time configuration properties to * override properties that are part of the plan. Raises the @@ -148,6 +162,18 @@ namespace CIAO ::Deployment::StartError)); /** + * The last step in launching an application in the + * domain-level. We establish connection bindings + * for external/shared components of this deployment plan + * components. + * Internally, this operation will invoke some operations + * on ExecutionManager to finish up this task. + */ + virtual void post_finishLaunch (void) + ACE_THROW_SPEC ((CORBA::SystemException, + Deployment::StartError)); + + /** * Starts the application. Raises the StartError exception if * starting the application fails. */ @@ -218,6 +244,13 @@ namespace CIAO */ int split_plan (void); + /** + * Construct <Component_Binding_Info> struct for the component instance. + * + * @para name component instance name + */ + Execution_Manager::Execution_Manager_Impl::Component_Binding_Info * + populate_binding_info (const char * name, const char * child_uuid); /** * Cache the incoming connections, which is a sequence of Connections, @@ -267,6 +300,12 @@ namespace CIAO /// Keep a pointer to the managing POA. PortableServer::POA_var poa_; + /// Pointer to the ExecutionManager_Impl "singleton" servant object + /// We could do this because ExecutionManager and DomainApplicationManager + /// are always collocated in the same process, so we don't have + /// to pass CORBA object reference back and forth. + Execution_Manager::Execution_Manager_Impl * execution_manager_; + /// Cache a object reference to this servant. /// Deployment::DomainApplicationManager_var objref_; diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp index c7af75c6f11..365cbb12e04 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.cpp @@ -66,6 +66,7 @@ namespace CIAO this->orb_.in (), this->poa_.in (), ::Deployment::TargetManager::_nil (), + this, // a plain C++ pointer plan, this->init_file_.c_str ()), CORBA::NO_MEMORY ()); @@ -233,9 +234,8 @@ namespace CIAO } Deployment::DeploymentPlan * - Execution_Manager_Impl::getPlan ( - const char * plan_uuid - ACE_ENV_ARG_DECL) + Execution_Manager_Impl::getPlan (const char * plan_uuid + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((::CORBA::SystemException)) { Deployment::DomainApplicationManager_var dam; @@ -264,5 +264,86 @@ namespace CIAO ACE_ENDTRY; ACE_CHECK; } + + void + Execution_Manager_Impl::finalize_global_binding ( + const Component_Binding_Info & binding, + CORBA::Boolean add_connection) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Deployment::InvalidConnection)) + { + // Find the NodeApplication hosting the component, and then call + // <finishLaunch> on it + ACE_TRY + { + Deployment::NodeApplication_var + node_app = this->find_node_application (binding); + + node_app->finishLaunch (binding.providedReference_.in (), + true, // start + true); // add_connection + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Execution_Manager_Impl::finalize_global_binding\t\n"); + ACE_THROW (Deployment::InvalidConnection ()); + } + ACE_ENDTRY; + } + + Deployment::NodeApplication_ptr + Execution_Manager_Impl:: + find_node_application (const Component_Binding_Info & binding) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Deployment::InvalidConnection)) + { + // Find the DAM based on plan_UUID + Deployment::DomainApplicationManager_var dam; + + if (this->map_.is_plan_available (binding.plan_uuid_)) + dam = this->map_.fetch_dam_reference (binding.plan_uuid_); + else + { + ACE_DEBUG ((LM_ERROR, + "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" + "CIAO::Execution_Manager_Impl::find_node_application -" + "Invalid plan uuid: %s!\n", binding.plan_uuid_.c_str ())); + ACE_THROW (::CORBA::BAD_PARAM ()); + } + + // Find the NA based on the NodeName field of the binding + // This is a CORBA call on the DAM + Deployment::NodeApplication_var + node_app = dam->get_node_app (binding.node_.c_str ()); + + if (CORBA::is_nil (node_app.in ())) + { + ACE_DEBUG ((LM_ERROR, + "DAnCE (%P|%t) ExecutionManager_Impl.cpp -" + "CIAO::Execution_Manager_Impl::find_node_application -" + "Invalid node name: %s!\n", binding.node_.c_str ())); + ACE_THROW (::CORBA::BAD_PARAM ()); + } + + return node_app._retn (); + } + + void + Execution_Manager_Impl:: + add_shared_component (const Component_Binding_Info & comp) + { + this->shared_components_.insert (comp); + } + + void + Execution_Manager_Impl:: + remove_shared_component (const Component_Binding_Info & comp) + { + this->shared_components_.remove (comp); + } + } } diff --git a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h index 7f6e3ab87dd..36b924dd3f8 100644 --- a/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h +++ b/TAO/CIAO/DAnCE/ExecutionManager/Execution_Manager_Impl.h @@ -42,6 +42,33 @@ namespace CIAO : public virtual POA_CIAO::ExecutionManagerDaemon { public: + + /// A struct which captures the binding information about a component + typedef struct _component_binding + { + _component_binding () + { + providedReference_ = 0; + } + + ACE_CString name_; + ACE_CString plan_uuid_; + ACE_CString node_; + + Deployment::Connections_var providedReference_; + + bool operator==(const struct _component_binding & comp) + { + if (this->name_ == comp.name_ && + this->plan_uuid_ == comp.plan_uuid_ && + this->node_ == comp.node_) + return true; + else + return false; + } + } Component_Binding_Info; + + /// Constructor Execution_Manager_Impl (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, const char * init_file); @@ -80,8 +107,8 @@ namespace CIAO // same UUID of the existing running plan. virtual void perform_redeployment ( - const Deployment::DeploymentPlan & plan - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + const Deployment::DeploymentPlan & plan + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((::CORBA::SystemException, ::Deployment::PlanError, ::Deployment::InstallationFailure, @@ -96,6 +123,38 @@ namespace CIAO ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((::CORBA::SystemException)); + /// ****************** C++ Methods ************************* + + /// If input <add_connection> is true, then it will add new + /// connections which are across different assemblies. Otherwise + /// it will remove the specified connections of this component. + /// + /// @@GD: Later we can add another method which could accept + /// a list of bindings and do the batch job. + virtual void finalize_global_binding ( + const Component_Binding_Info & binding, + CORBA::Boolean add_connection) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Deployment::InvalidConnection)); + + /// Add shared component information. + /// This call will be made by DomainApplicationManager. + virtual void + add_shared_component (const Component_Binding_Info & binding); + + /// Remove shared component + virtual void + remove_shared_component (const Component_Binding_Info & binding); + + protected: + /// Return the NodeApplication hosting the given biding + virtual Deployment::NodeApplication_ptr + find_node_application (const Component_Binding_Info & binding) + ACE_THROW_SPEC (( + ::CORBA::SystemException, + ::Deployment::InvalidConnection)); + protected: /// Destructor. ~Execution_Manager_Impl (void); @@ -106,10 +165,14 @@ namespace CIAO /// Cached POA pointer PortableServer::POA_var poa_; - // Path to the initialization file + /// Path to the initialization file const ACE_CString init_file_; + /// A map which caches the DomainApplicationManager object ref. DAM_Map map_; + + /// A set of shared components and their location info. + ACE_Unbounded_Set<Component_Binding_Info> shared_components_; }; } } diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp index 9e9b35a5c49..4492e43205d 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.cpp @@ -58,7 +58,7 @@ void CIAO::NodeApplication_Impl::finishLaunch ( const Deployment::Connections & providedReference, CORBA::Boolean start, - CORBA::Boolean is_ReDAC + CORBA::Boolean add_connection ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, @@ -66,17 +66,17 @@ CIAO::NodeApplication_Impl::finishLaunch ( { ACE_UNUSED_ARG (start); - // If parameter "is_ReDAC" is true, then it means we want to "remove" - // existing connections. Otherwise, it means we want to "add" new - // connections - this->finishLaunch_i (providedReference, start, is_ReDAC); + // If parameter "add_connection" is true, then it means we want to "add" + // new connections, other, we remove existing connections + this->finishLaunch_i (providedReference, start, add_connection); } +// if <false>, then we shall remove connections. void CIAO::NodeApplication_Impl::finishLaunch_i ( const Deployment::Connections & providedReference, CORBA::Boolean start, - bool is_ReDAC + CORBA::Boolean add_connection ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, @@ -126,7 +126,7 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( name.c_str ())); } - if (!is_ReDAC) + if (add_connection) { ::Components::Cookie_var cookie = comp->connect (providedReference[i].portName.in (), @@ -210,7 +210,7 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( name.c_str ())); } - if (!is_ReDAC) + if (add_connection) { comp->connect_consumer (providedReference[i].portName.in (), consumer.in () @@ -280,7 +280,7 @@ CIAO::NodeApplication_Impl::finishLaunch_i ( name.c_str ())); } - if (!is_ReDAC) + if (add_connection) { ::Components::Cookie_var cookie = comp->subscribe (providedReference[i].portName.in (), diff --git a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h index 92152bd38ab..dde2a353750 100644 --- a/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplication/NodeApplication_Impl.h @@ -85,7 +85,7 @@ namespace CIAO virtual void finishLaunch (const Deployment::Connections & providedReference, CORBA::Boolean start, - CORBA::Boolean is_ReDAC + CORBA::Boolean add_connection ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, @@ -198,7 +198,7 @@ namespace CIAO virtual void finishLaunch_i (const Deployment::Connections & providedReference, CORBA::Boolean start, - bool is_establishing_connection + CORBA::Boolean add_connection ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError, diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index 34adc2a7b4e..11ff03aa2c1 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -160,6 +160,15 @@ startLaunch (const Deployment::Properties & configProperty, CIAO_TRACE("CIAO::NodeApplicationManager_Impl::startLaunch"); ACE_UNUSED_ARG (configProperty); ACE_UNUSED_ARG (start); + + // If no additional components need to be installed, then we simply + // create a NA, but doesn't install any components on it. + if (this->plan_.instance.length () == this->shared_components_.length ()) + { + ACE_DEBUG ((LM_DEBUG, "Prespawn a NodeApplication process without " + "installing any components.\n")); + } + /** * 1. First Map properties to TAO/CIAO specific property/configurations * 2. Necessary property checking (needed?) @@ -253,8 +262,8 @@ startLaunch (const Deployment::Properties & configProperty, for (CORBA::ULong j = 0; j < shared_comp_length; ++j) { if (this->component_map_. - bind (this->shared_components_[j].in (), - Components::CCMObject::_nil ())) + bind (this->shared_components_[j].in (), + Components::CCMObject::_nil ())) { ACE_CString error ("Duplicate component instance name "); error += this->shared_components_[j].in(); @@ -536,7 +545,6 @@ CIAO::NodeApplicationManager_Impl::init ( ACE_TRY_THROW (CORBA::BAD_PARAM ()); } - if (delay == 0) { ACE_ERROR ((LM_ERROR, diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h index eb5d1057edb..e37eca6ff8c 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h @@ -45,14 +45,18 @@ namespace CIAO public: /// Constructor NodeApplicationManager_Impl_Base (CORBA::ORB_ptr o, - PortableServer::POA_ptr p); + PortableServer::POA_ptr p); /*=========================================================== * Below are operations from the NodeApplicationManager * *============================================================*/ - //@@ The return type is NodeApplication_ptr actually. + /// The return type is NodeApplication_ptr actually. + /// For "external/shared" components of this child plan, they are + /// not actaully installed, however, the object references + /// of the ports of these external components are returned + /// through <providedReference>. virtual Deployment::Application_ptr startLaunch (const Deployment::Properties & configProperty, Deployment::Connections_out providedReference, diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp index 5e99d7e7896..cffa9c3b582 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.cpp @@ -403,12 +403,16 @@ destroyPlan (const Deployment::DeploymentPlan & plan nam->destroyApplication (0); - // The problem is that we should NOT actually kill the NA process if // there are some components that are shared by other plans. - } +CORBA::StringSeq * +CIAO::NodeManager_Impl_Base:: +get_shared_components (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->shared_components_seq (); +} bool CIAO::NodeManager_Impl_Base:: diff --git a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h index 70efed019dc..59b2a98ae90 100644 --- a/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h +++ b/TAO/CIAO/DAnCE/NodeManager/NodeManager_Impl.h @@ -95,13 +95,18 @@ namespace CIAO Deployment::StopError, Deployment::InvalidReference)); - // CIAO specific extension, which is particularly useful for dealing with - // shared components issue + /// CIAO specific extension, which is particularly useful for dealing with + /// shared components issue virtual void destroyPlan (const Deployment::DeploymentPlan & plan ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((::CORBA::SystemException, ::Deployment::StopError)); + /// CIAO specific extension, return a set of shared components + virtual CORBA::StringSeq * + get_shared_components (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((::CORBA::SystemException)); + // ********* CIAO Specific Helper functions ************ virtual const ::Components::FacetDescriptions & @@ -173,6 +178,8 @@ namespace CIAO ACE_Null_Mutex> Reference_Count_Map; typedef Reference_Count_Map::iterator Ref_Count_Iterator; + /// @@TODO We should also keep the information about *where* the + /// component is installed Reference_Count_Map ref_count_map_; /// A set to track the names of shared component instances diff --git a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index 230ac14beb3..6b7164d41bf 100644 --- a/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -275,7 +275,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - ACE_DEBUG ((LM_DEBUG, "NEW PLAN LAUNCHER\n")); + //ACE_DEBUG ((LM_DEBUG, "NEW PLAN LAUNCHER\n")); return run_main_implementation (argc, argv); } diff --git a/TAO/CIAO/ciao/Deployment.idl b/TAO/CIAO/ciao/Deployment.idl index a5534b06517..b7d1b975a4c 100644 --- a/TAO/CIAO/ciao/Deployment.idl +++ b/TAO/CIAO/ciao/Deployment.idl @@ -65,7 +65,6 @@ module Deployment { /// CIAO specific version of startLaunch implementation, this one /// differs with spec-defined operation in the sense that it doesn't /// return DomainApplication object reference. - void startLaunch (in Properties configProperty, in boolean start) raises (ResourceNotAvailable, StartError, InvalidProperty); @@ -76,15 +75,22 @@ module Deployment { void start () raises (StartError); - // CIAO speicifc extension + /// CIAO specific extention + /// Fetch NodeApplication based on the given node name + NodeApplication get_node_app (in string node_name) + raises (NoSuchName); + + /// CIAO speicifc extension, it differs with the spec defined one + /// for no input parameter. void destroyApplication () raises (StopError); - // CIAO specific extension to destroy NodeApplicationManager + /// CIAO specific extension to destroy NodeApplicationManager void destroyManager () raises (StopError); - // Perform the actual redeployment and reconfiguration on the dommain level. + /// CIAO specific extension + /// Perform the actual redeployment and reconfiguration on the dommain level. void perform_redeployment (in DeploymentPlan new_plan) raises (PlanError, InstallationFailure, @@ -110,6 +116,10 @@ module Deployment { void destroyManager (in DomainApplicationManager manager) raises (StopError); + /// CIAO specific extention + /// "Get" operation, return the DeploymentPlan + DeploymentPlan getPlan (in string plan_uuid); + /// CIAO specific operation to handle dynamic system redeployment /// and reconfiguration /// This operation could handle dynamic redeployment, and this @@ -124,9 +134,6 @@ module Deployment { InvalidConnection, InvalidProperty, ::Components::RemoveFailure); - - // Get operation - DeploymentPlan getPlan (in string plan_uuid); }; interface TargetManager { @@ -182,13 +189,17 @@ module Deployment { void destroyManager (in NodeApplicationManager appManager) raises (StopError, InvalidReference); - // CIAO specific extension - // Destroy the NAM and all the associated NAs with this child_plan - // We can guarantee that the input DeploymentPlan is valid, since it - // is fetched from the cached DeploymentPlan of DAM, which has been - // validated before. + /// CIAO specific extension + /// Destroy the NAM and all the associated NAs with this child_plan + /// We can guarantee that the input DeploymentPlan is valid, since it + /// is fetched from the cached DeploymentPlan of DAM, which has been + /// validated before. void destroyPlan (in DeploymentPlan plan) raises (StopError); + + /// CIAO specific extension + /// Get all the shared components installed in this node + CORBA::StringSeq get_shared_components (); }; interface RepositoryManager { |