diff options
author | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-10-26 16:48:33 +0000 |
---|---|---|
committer | dengg <dengg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-10-26 16:48:33 +0000 |
commit | 69c00bb3bb23dd688901d85af009a7a3aa32857c (patch) | |
tree | 3d668ee8ec7a09f9371a0c85c49cd930b9a4ecff | |
parent | 87031834042a7296dc36051243d7722436051de6 (diff) | |
download | ATCD-69c00bb3bb23dd688901d85af009a7a3aa32857c.tar.gz |
Merged from CIAO-events-3 branch.
-rw-r--r-- | modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp | 36 | ||||
-rw-r--r-- | modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp | 140 | ||||
-rw-r--r-- | modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h | 5 |
3 files changed, 62 insertions, 119 deletions
diff --git a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp index 73f208c72b1..dc0b7965c6e 100644 --- a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp +++ b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp @@ -17,7 +17,7 @@ namespace CIAO bool use_package_name = true; const char* package_names = 0; const char* package_types = 0; - const char* new_deployment_plan_url = 0; + const char* new_package_url = 0; const char* plan_uuid = 0; bool em_use_naming = false; const char* em_ior_file = "file://em.ior"; @@ -114,7 +114,7 @@ namespace CIAO mode = pl_mode_stop_by_uuid; break; case 'r': - new_deployment_plan_url = get_opt.opt_arg (); + new_package_url = get_opt.opt_arg (); mode = pl_mode_redeployment; break; case 'h': @@ -129,7 +129,7 @@ namespace CIAO (package_names == 0) && (package_types == 0) && (deployment_plan_url == 0) && - (new_deployment_plan_url == 0)) + (new_package_url == 0)) { usage (argv[0]); return false; @@ -202,7 +202,7 @@ namespace CIAO if (mode == pl_mode_start || mode == pl_mode_interactive) // initial deployment { - const char* uuid = 0; + const char* uuid; if (package_names != 0) uuid = launcher.launch_plan (deployment_plan_url, @@ -226,9 +226,7 @@ namespace CIAO // Write out DAM ior if requested if (mode == pl_mode_start) - { - write_dap_ior (orb.in (), dapp_mgr.in ()); - } + write_dap_ior (orb.in (), dapp_mgr.in ()); else // if (pl_mode_interactive) { ACE_DEBUG ((LM_DEBUG, @@ -245,23 +243,11 @@ namespace CIAO "unkonw plan uuid.\n")); } } - else if (mode == pl_mode_redeployment && new_deployment_plan_url != 0) // do redeployment + else if (mode == pl_mode_redeployment && new_package_url != 0) // do redeployment { ACE_DEBUG ((LM_DEBUG, "Plan_Launcher: reconfigure application assembly.....")); - - const char* uuid; - - if (package_names != 0) - uuid = launcher.re_launch_plan (new_deployment_plan_url, - package_names, - use_package_name, - use_repoman); - else - uuid = launcher.re_launch_plan (new_deployment_plan_url, - package_types, - use_package_name, - use_repoman); + const char* uuid = launcher.re_launch_plan (new_package_url); if (uuid == 0) { @@ -294,11 +280,9 @@ namespace CIAO ACE_DEBUG ((LM_DEBUG, "Plan_Launcher: destroy the application.....")); if (! launcher.teardown_plan (plan_uuid)) - { - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_DEBUG, "(%P|%t) CIAO_PlanLauncher:tear down assembly failed: " - "unkown plan uuid.\n")); - } + "unkonw plan uuid.\n")); } orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); @@ -307,7 +291,7 @@ namespace CIAO ACE_CATCH (Plan_Launcher_i::Deployment_Failure, ex) { ACE_ERROR ((LM_ERROR, - "Deployment failed. Plan_Launcher exiting.\n")); + "Deployment failed. Plan_Launcher exiting.\n")); } ACE_CATCHANY { diff --git a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp index 7a8793ec559..e15485fbc1e 100644 --- a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp +++ b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.cpp @@ -2,7 +2,6 @@ #include "Plan_Launcher_Impl.h" #include "orbsvcs/CosNamingC.h" #include "Config_Handlers/XML_File_Intf.h" -#include "Config_Handlers/DnC_Dump.h" #include <iostream> #include <string> @@ -27,7 +26,7 @@ namespace CIAO CosNaming::Name name (1); name.length (1); - + name[0].id = CORBA::string_dup ("ExecutionManager"); return pns->resolve (name @@ -75,11 +74,9 @@ namespace CIAO } if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) CIAO_PlanLauncher: Obtained Execution" - " Manager ref \n")); - } + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) CIAO_PlanLauncher: Obtained Execution" + " Manager ref \n")); if (use_repoman) return pg_.init (orb, rm_use_naming, rm_name); @@ -111,7 +108,7 @@ namespace CIAO } ACE_DEBUG ((LM_DEBUG, "Parsing complete....\n")); - + return this->launch_plan (plan.in ()); } @@ -121,54 +118,42 @@ namespace CIAO { ACE_TRY { - if (CORBA::is_nil (this->em_.in ())) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("CIAO::Plan_Launcher_i: ") - ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); - return 0; - } - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("about to call this->em_->preparePlan\n"))); - } - - ::Deployment::DomainApplicationManager_var dam (this->em_->preparePlan (plan, 1)); - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("CIAO::Plan_Launcher_i: " ) - ACE_TEXT ("after to call this->em_->preparePlan\n"))); - } - - if (CORBA::is_nil (dam.in ())) - { - ACE_ERROR ((LM_ERROR, - "(%P|%t) CIAO_PlanLauncher:preparePlan call failed: " - "nil DomainApplicationManager reference\n")); - return 0; - } - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: Obtained DAM ref \n")); - } - - ::Deployment::Properties_var properties; - ACE_NEW_RETURN (properties, - Deployment::Properties, - 0); - - if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: start Launch application...\n")); - } + if (CORBA::is_nil (this->em_.in ())) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("CIAO::Plan_Launcher_i: ") + ACE_TEXT ("launch_plan called witn an uninitialized EM.\n"))); + return 0; + } + + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("about to call this->em_->preparePlan\n"))); + ::Deployment::DomainApplicationManager_var dam (this->em_->preparePlan (plan, 1)); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("CIAO::Plan_Launcher_i: " ) + ACE_TEXT ("after to call this->em_->preparePlan\n"))); + + if (CORBA::is_nil (dam.in ())) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) CIAO_PlanLauncher:preparePlan call failed: " + "nil DomainApplicationManager reference\n")); + return 0; + } + + if (CIAO::debug_level () > 9) + ACE_DEBUG ((LM_DEBUG, + "CIAO_PlanLauncher: Obtained DAM ref \n")); + + ::Deployment::Properties_var properties; + ACE_NEW_RETURN (properties, + Deployment::Properties, + 0); + + if (CIAO::debug_level ()) + ACE_DEBUG ((LM_DEBUG, + "CIAO_PlanLauncher: start Launch application...\n")); // Dont not start the Application immediately since it vialtes // the semantics of component activation sequence @@ -294,9 +279,7 @@ namespace CIAO { dapp_mgr->destroyApplication (); if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } + ACE_DEBUG ((LM_DEBUG, "[success]\n")); // Note that we should ask the DAM to tell EM whether the DAM should // be destroyed @@ -305,7 +288,7 @@ namespace CIAO } ACE_CATCHANY { - ACE_ERROR ((LM_ERROR, "Unable to find DomainApplicationManager " + ACE_DEBUG ((LM_ERROR, "Unable to find DomainApplicationManager " "for plan with uuid: %s\n", uuid)); return false; } @@ -319,17 +302,13 @@ namespace CIAO ACE_ENV_ARG_DECL) { if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the application.....\n")); - } + ACE_DEBUG ((LM_DEBUG, + "CIAO_PlanLauncher: destroy the application.....\n")); dam->destroyApplication (); if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } + ACE_DEBUG ((LM_DEBUG, "[success]\n")); this->destroy_dam (dam); @@ -341,17 +320,13 @@ namespace CIAO ACE_ENV_ARG_DECL) { if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, - "CIAO_PlanLauncher: destroy the manager.....\n")); - } + ACE_DEBUG ((LM_DEBUG, + "CIAO_PlanLauncher: destroy the manager.....\n")); this->em_->destroyManager (dam); if (CIAO::debug_level ()) - { - ACE_DEBUG ((LM_DEBUG, "[success]\n")); - } + ACE_DEBUG ((LM_DEBUG, "[success]\n")); } void @@ -369,27 +344,14 @@ namespace CIAO } const char * - Plan_Launcher_i::re_launch_plan (const char *deployment_plan_uri, - const char *package_uri, - bool use_package_name, - bool use_repoman - ACE_ENV_ARG_DECL) + Plan_Launcher_i::re_launch_plan (const char *plan_uri ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((Plan_Launcher_i::Deployment_Failure)) { - CIAO::Config_Handlers::XML_File_Intf intf (deployment_plan_uri); + CIAO::Config_Handlers::XML_File_Intf intf (plan_uri); ::Deployment::DeploymentPlan_var plan = intf.get_plan (); - // Use the package name(s) or type(s) to modify the location of all the - // artifacts in DeploymentPlan. - if (use_repoman) - { - pg_.generate_plan (plan, package_uri, use_package_name); - } - - //::Deployment::DnC_Dump::dump (plan.in ()); - return this->re_launch_plan (plan.in ()); } diff --git a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h index 085ee4d8c0c..2a4254e7262 100644 --- a/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h +++ b/modules/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl.h @@ -60,10 +60,7 @@ namespace CIAO ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment_Failure)); - const char * re_launch_plan (const char *deployment_plan_uri, - const char *package_uri = 0, - bool use_package_name = 1, - bool use_repoman = 0 + const char * re_launch_plan (const char *plan_uri ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((Deployment_Failure)); |