summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2010-03-04 13:58:58 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2010-03-04 13:58:58 +0000
commit1bcf221d0785cf00f759075a9525cb54e20bc46f (patch)
treedc40e3c41629b2e5aa5eb120bc62a5d9c48ef53e
parent884d95f14113fa87379db161f7eae0a92b6f6b14 (diff)
downloadATCD-1bcf221d0785cf00f759075a9525cb54e20bc46f.tar.gz
Thu Mar 4 13:57:48 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
* DAnCE/Plan_Launcher/EM_Launcher.h: * DAnCE/Plan_Launcher/NM_Launcher.h: * DAnCE/Plan_Launcher/Plan_Launcher.cpp: Fixed comments from Johnny. * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.h: * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp: * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h: * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp: * DAnCE/Plan_Launcher/Plan_Launcher.mpc: Renamed these files to have _T suffix.
-rw-r--r--CIAO/ChangeLog20
-rw-r--r--CIAO/DAnCE/Plan_Launcher/EM_Launcher.h2
-rw-r--r--CIAO/DAnCE/Plan_Launcher/NM_Launcher.h2
-rw-r--r--CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp83
-rw-r--r--CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc2
-rw-r--r--CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp (renamed from CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp)18
-rw-r--r--CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.h (renamed from CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h)4
7 files changed, 48 insertions, 83 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index 8a5f5c4165b..3a7ab291671 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,11 +1,27 @@
+Thu Mar 4 13:57:48 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * DAnCE/Plan_Launcher/EM_Launcher.h:
+ * DAnCE/Plan_Launcher/NM_Launcher.h:
+ * DAnCE/Plan_Launcher/Plan_Launcher.cpp:
+
+ Fixed comments from Johnny.
+
+ * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.h:
+ * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp:
+ * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h:
+ * DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp:
+ * DAnCE/Plan_Launcher/Plan_Launcher.mpc:
+
+ Renamed these files to have _T suffix.
+
Thu Mar 4 13:30:45 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
* DAnCE/tools/Convert_Plan/Convert_Plan_Impl.cpp:
Fixed an error-checking problem whereby an invalid filename
didn't result in function exit properly. Thanks to Johnny
- Willemsen for pointing this out.
-
+ Willemsen for pointing this out.
+
Thu Mar 4 13:27:35 UTC 2010 William R. Otte <wotte@dre.vanderbilt.edu>
* DAnCE/Plan_Launcher/EM_Launcher.h:
diff --git a/CIAO/DAnCE/Plan_Launcher/EM_Launcher.h b/CIAO/DAnCE/Plan_Launcher/EM_Launcher.h
index 66a369bb5ff..06f70fa46be 100644
--- a/CIAO/DAnCE/Plan_Launcher/EM_Launcher.h
+++ b/CIAO/DAnCE/Plan_Launcher/EM_Launcher.h
@@ -10,7 +10,7 @@
#ifndef DANCE_PLAN_LAUNCHER_EM
#define DANCE_PLAN_LAUNCHER_EM
-#include "Plan_Launcher_Base_Impl.h"
+#include "Plan_Launcher_Base_Impl_T.h"
#include "DAnCE/Deployment/Deployment_DomainApplicationC.h"
#include "DAnCE/Deployment/Deployment_DomainApplicationManagerC.h"
diff --git a/CIAO/DAnCE/Plan_Launcher/NM_Launcher.h b/CIAO/DAnCE/Plan_Launcher/NM_Launcher.h
index 60fdb77d1c0..c089c37c7bb 100644
--- a/CIAO/DAnCE/Plan_Launcher/NM_Launcher.h
+++ b/CIAO/DAnCE/Plan_Launcher/NM_Launcher.h
@@ -10,7 +10,7 @@
#ifndef DANCE_PLAN_LAUNCHER_NM
#define DANCE_PLAN_LAUNCHER_NM
-#include "Plan_Launcher_Base_Impl.h"
+#include "Plan_Launcher_Base_Impl_T.h"
#include "DAnCE/Deployment/Deployment_NodeApplicationC.h"
#include "DAnCE/Deployment/Deployment_NodeApplicationManagerC.h"
diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
index a94b57f9c5a..eb021f75416 100644
--- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
+++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.cpp
@@ -14,63 +14,6 @@
//#include "Plan_Launcher_Impl.h"
-ACE_CString
-expand_env_vars (const ACE_TCHAR * s)
-{
- ACE_TString src(s);
- ACE_TString res;
- size_t pos_done = 0;
- while (pos_done < (size_t) src.length())
- {
- size_t pos_start = src.find ('$', pos_done);
- if (ACE_TString::npos == pos_start)
- {
- res += src.substring (pos_done);
- pos_done = src.length();
- }
- else // take the substring before '$' and append value
- {
- if (pos_start > pos_done)
- {
- res += src.substring (pos_done, pos_start - pos_done);
- pos_done = pos_start;
- }
-
- size_t pos_end = src.length();
-
- size_t p;
-
- p = src.find (ACE_TEXT(' '), pos_start + 1);
- if (ACE_TString::npos != p && pos_end > p) pos_end = p;
-
- p = src.find (ACE_TEXT('/'), pos_start + 1);
- if (ACE_TString::npos != p && pos_end > p) pos_end = p;
-
- p = src.find (ACE_TEXT('\\'), pos_start + 1);
- if (ACE_TString::npos != p && pos_end > p) pos_end = p;
-
- p = src.find (ACE_TEXT('$'), pos_start + 1);
- if (ACE_TString::npos != p && pos_end > p) pos_end = p;
-
- if (pos_end - pos_start > 1)
- {
- ACE_Env_Value<const ACE_TCHAR*> val (src.substring (pos_start + 1, pos_end - pos_start - 1).c_str(), 0);
- res += val;
- pos_done = pos_end;
- }
- else
- {
- DANCE_DEBUG (6, (LM_WARNING, DLINFO
- ACE_TEXT("Plan_Launcher::expand_env_vars - ")
- ACE_TEXT("Envvar can not be parsed out at %i in \"<%s>\""),
- pos_start,
- src.c_str()));
- }
- }
- }
- return res;
-}
-
namespace
{
struct Options
@@ -137,7 +80,7 @@ usage(const ACE_TCHAR*)
ACE_TEXT ("The default action is to fully launch a plan. The following options may be used\n")
ACE_TEXT ("to arrive at a different state\n")
ACE_TEXT ("\t-l|--launch-plan\t\tLaunch the plan (Requires CDR/XML plan)\n")
- ACE_TEXT ("\t-s|--stop-plan\t\t\tStop the plan\n (Requires Plan, UUID, or APP/AM references")
+ ACE_TEXT ("\t-s|--stop-plan\t\t\tStop the plan (Requires Plan, UUID, or APP/AM references")
ACE_TEXT ("\nOther Options\n")
ACE_TEXT ("\t-o|--output[prefix]\t\tOutput IOR files that result from plan control action,")
@@ -423,6 +366,7 @@ int teardown_plan (const Options &opts,
}
else
{
+ // Need to perform lookup by uuid, either explicitly provided or in plan.
ACE_CString uuid;
if (plan)
uuid = plan->UUID.in ();
@@ -431,7 +375,7 @@ int teardown_plan (const Options &opts,
DAnCE::EM_Launcher *em_launcher = dynamic_cast <DAnCE::EM_Launcher *> (pl_base);
- if (!pl_base)
+ if (!em_launcher)
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher::teardown_plan - ")
ACE_TEXT ("Error: Attempting UUID lookup on non-EM managed plan not supported\n")));
@@ -486,6 +430,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
DANCE_DISABLE_TRACE ();
int retval = 0;
+ CORBA::ORB_var orb;
try
{
@@ -500,7 +445,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
DANCE_DEBUG (6, (LM_TRACE, DLINFO
ACE_TEXT("PlanLauncher - initializing ORB\n")));
- CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+ orb = CORBA::ORB_init (argc, argv);
Options options;
if (!parse_args (argc, argv, options))
@@ -515,12 +460,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
if (options.em_ior_)
{
+ // Resolve ExecutionManager IOR for EM base deployment.
DAnCE::EM_Launcher *em_pl (0);
CORBA::Object_var obj = orb->string_to_object (options.em_ior_);
Deployment::ExecutionManager_var tmp_em = Deployment::ExecutionManager::_narrow (obj);
- if (CORBA::is_nil (tmp_em))
+ if (CORBA::is_nil (tmp_em.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher - ")
ACE_TEXT ("Unable to resolve ExecutionManager reference <%s>\n"),
@@ -534,16 +480,16 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CORBA::NO_MEMORY ());
pl_base.reset (em_pl);
-
}
else
{
+ // Resolve NM IOR for NM based deployment.
DAnCE::NM_Launcher *nm_pl (0);
CORBA::Object_var obj = orb->string_to_object (options.nm_ior_);
Deployment::NodeManager_var tmp_em = Deployment::NodeManager::_narrow (obj);
- if (CORBA::is_nil (tmp_em))
+ if (CORBA::is_nil (tmp_em.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher - ")
ACE_TEXT ("Unable to resolve NodeManager reference <%s>\n"),
@@ -579,7 +525,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
if (!dp.ptr ())
{
- ACE_ERROR ((LM_ERROR, DLINFO ACE_TEXT ("PlanLauncher - Error: Unable to read in XML plan\n")));
+ ACE_ERROR ((LM_ERROR, DLINFO ACE_TEXT ("PlanLauncher - Error: Unable to read in CDR plan\n")));
return -1;
}
}
@@ -596,8 +542,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
break;
default:
- DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher -")
- ACE_TEXT ("Mode not yet supported\n")));
+ ACE_ERROR ((LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher -")
+ ACE_TEXT ("Mode not yet supported\n")));
break;
};
@@ -608,16 +554,19 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_ERROR ((LM_ERROR, DLINFO "PlanLauncher - Error: %C.\n", e.ex_.c_str()));
retval = -1;
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ACE_ERROR ((LM_ERROR, DLINFO "PlanLauncher - Error: %C\n", ex._info ().c_str ()));
retval = -1;
+ orb->destroy ();
}
catch (...)
{
- DANCE_ERROR (1, (LM_ERROR, "PlanLauncher - Error: Unknown exception.\n"));
+ ACE_ERROR ((LM_ERROR, "PlanLauncher - Error: Unknown exception.\n"));
retval = -1;
+ orb->destroy ();
}
return retval;
diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc
index 800a6b3b219..00f939a7541 100644
--- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc
+++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher.mpc
@@ -10,7 +10,7 @@ project(DAnCE_Plan_Launcher_Impl) : dance_lib, dance_logger, dance_convert_plan,
}
Template_Files {
- Plan_Launcher_Base_Impl.cpp
+ Plan_Launcher_Base_Impl_T.cpp
}
}
diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp
index 679fece53ac..620ff1133a8 100644
--- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.cpp
+++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp
@@ -3,7 +3,7 @@
#ifndef PLAN_LAUNCHER_BASE_IMPL_CPP
#define PLAN_LAUNCHER_BASE_IMPL_CPP
-#include "Plan_Launcher_Base_Impl.h"
+#include "Plan_Launcher_Base_Impl_T.h"
#include "ace/Env_Value_T.h"
#include "ace/OS_NS_stdio.h"
@@ -29,14 +29,14 @@ namespace DAnCE
manager_ (Manager::_duplicate (manager))
{
DANCE_TRACE ("Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl");
- if (CORBA::is_nil (this->orb_))
+ if (CORBA::is_nil (this->orb_.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - "
"Plan Launcher requires a valid ORB\n"));
throw Deployment_Failure ("Plan launcher requires a valid ORB\n");
}
- if (CORBA::is_nil (this->manager_))
+ if (CORBA::is_nil (this->manager_.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO "Plan_Launcher_Base_Impl::Plan_Launcher_Base_Impl - "
"Plan Launcher requires a valid Manager reference.\n"));
@@ -109,7 +109,7 @@ namespace DAnCE
AppManager_var app_manager (AppManager::_narrow (app_mgr));
- if (CORBA::is_nil (app_manager))
+ if (CORBA::is_nil (app_manager.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher_Base_Impl::start_launch - ")
ACE_TEXT ("Nil ApplicationManager reference\n")));
@@ -159,7 +159,7 @@ namespace DAnCE
Application_var application (Application::_narrow (app));
- if (CORBA::is_nil (application))
+ if (CORBA::is_nil (application.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT("Plan_Launcher_Base_Impl::launch_plan - ")
ACE_TEXT("Nil Application reference.\n")));
@@ -193,7 +193,7 @@ namespace DAnCE
Application_var application (Application::_narrow (app));
- if (CORBA::is_nil (application))
+ if (CORBA::is_nil (application.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT("Plan_Launcher_Base_Impl::start - ")
ACE_TEXT("Nil Application reference.\n")));
@@ -325,7 +325,7 @@ namespace DAnCE
AppManager_var am (AppManager::_narrow (am_obj));
- if (CORBA::is_nil (am))
+ if (CORBA::is_nil (am.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT("Plan_Launcher_Base_Impl::teardown_application - ")
ACE_TEXT("Nil ApplicationManager reference.\n")));
@@ -334,7 +334,7 @@ namespace DAnCE
Application_var app (Application::_narrow (app_obj));
- if (CORBA::is_nil (app))
+ if (CORBA::is_nil (app.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT("Plan_Launcher_Base_Impl::teardown_appliocation - ")
ACE_TEXT("Nil Application reference.\n")));
@@ -375,7 +375,7 @@ namespace DAnCE
AppManager_var am (AppManager::_narrow (am_obj));
- if (CORBA::is_nil (am))
+ if (CORBA::is_nil (am.in ()))
{
DANCE_ERROR (1, (LM_ERROR, DLINFO ACE_TEXT("Plan_Launcher_Base_Impl::destroy_app_manager - ")
ACE_TEXT("Nil ApplicationManager reference.\n")));
diff --git a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.h
index 7c2fd8a94b7..f77ccd2cf0d 100644
--- a/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl.h
+++ b/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Base_Impl_T.h
@@ -82,11 +82,11 @@ namespace DAnCE
}
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
-#include "Plan_Launcher/Plan_Launcher_Base_Impl.cpp"
+#include "Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
-#pragma implementation ("Plan_Launcher_Base_Impl.cpp")
+#pragma implementation ("Plan_Launcher_Base_Impl_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#endif /* PLAN_LAUNCHER_BASE_IMPL_H */