summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-04-10 19:39:19 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2011-04-10 19:39:19 +0000
commit62f510aa440dc27433930a248be6eeecd310be5a (patch)
tree961d4d6a7b482dfb83b22c3d1e0b8c63ba6e7297
parent6067b47def2e889264d191d27ae31e84be97f577 (diff)
downloadATCD-62f510aa440dc27433930a248be6eeecd310be5a.tar.gz
Sun Apr 10 19:38:22 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
* dance/Plan_Launcher/LM_Launcher.h: * dance/Plan_Launcher/LM_Launcher.cpp: * dance/Plan_Launcher/Plan_Launcher.cpp: * dance/Plan_Launcher/Plan_Launcher.mpc: * dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp: Add capability to launch directly to the LocalityManager.
-rw-r--r--DAnCE/ChangeLog10
-rw-r--r--DAnCE/dance/Plan_Launcher/LM_Launcher.cpp72
-rw-r--r--DAnCE/dance/Plan_Launcher/LM_Launcher.h42
-rw-r--r--DAnCE/dance/Plan_Launcher/Plan_Launcher.cpp52
-rw-r--r--DAnCE/dance/Plan_Launcher/Plan_Launcher.mpc7
-rw-r--r--DAnCE/dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp2
6 files changed, 179 insertions, 6 deletions
diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog
index 5a02bfcb362..ef193c8a0bc 100644
--- a/DAnCE/ChangeLog
+++ b/DAnCE/ChangeLog
@@ -1,3 +1,13 @@
+Sun Apr 10 19:38:22 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
+
+ * dance/Plan_Launcher/LM_Launcher.h:
+ * dance/Plan_Launcher/LM_Launcher.cpp:
+ * dance/Plan_Launcher/Plan_Launcher.cpp:
+ * dance/Plan_Launcher/Plan_Launcher.mpc:
+ * dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp:
+
+ Add capability to launch directly to the LocalityManager.
+
Sun Apr 10 17:37:43 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* tools/Logger_Backend/ndds/NDDS_Logger.mpc:
diff --git a/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp b/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp
new file mode 100644
index 00000000000..de595a0672c
--- /dev/null
+++ b/DAnCE/dance/Plan_Launcher/LM_Launcher.cpp
@@ -0,0 +1,72 @@
+// $Id$
+
+#include "LM_Launcher.h"
+
+namespace DAnCE
+{
+ LM_Launcher::LM_Launcher (CORBA::ORB_ptr orb,
+ __Base::Manager_ptr manager)
+ : __Base (orb, manager)
+ {
+ }
+
+
+
+ LM_Launcher::~LM_Launcher (void)
+ {
+
+ }
+
+ /*
+ bool
+ LM_Launcher::lookup_by_uuid (const char *uuid,
+ CORBA::Object_out am,
+ CORBA::Object_out app)
+ {
+ DANCE_TRACE ("LM_Launcher::lookup_by_uuid");
+
+ try
+ {
+ ::Deployment::ApplicationManagers_var managers = this->manager_->getManagers ();
+
+ for (CORBA::ULong i = 0; i < managers->length (); ++i)
+ {
+ ::Deployment::DeploymentPlan_var plan (managers[i]->getPlan ());
+ ACE_CString plan_uuid (plan->UUID.in ());
+ if (plan_uuid == uuid)
+ {
+ am = CORBA::Object::_duplicate (managers[i]);
+
+ ::Deployment::Applications_var apps = managers[i]->getApplications ();
+
+ if (apps->length () != 0)
+ {
+ app = CORBA::Object::_duplicate ((*apps)[0]);
+ return true;
+ }
+ else return false;
+ }
+ }
+ }
+ catch (const CORBA::Exception &ex)
+ {
+ DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
+ (LM_ERROR, DLINFO
+ ACE_TEXT ("LM_Launcher::lookup_by_uuid - ")
+ ACE_TEXT ("Caught CORBA Exception: %C\n"),
+ ex._info ().c_str ()));
+ throw Deployment_Failure (ex._info ());
+ }
+ catch (...)
+ {
+ DANCE_ERROR (DANCE_LOG_TERMINAL_ERROR,
+ (LM_ERROR, DLINFO
+ ACE_TEXT ("LM_Launcher::lookup_by_uuid - ")
+ ACE_TEXT ("Unknown C++ exception\n")));
+ throw Deployment_Failure ("Unknown C++ exception in lookup_by_uuid\n");
+ }
+
+ return false;
+ }
+ */
+}
diff --git a/DAnCE/dance/Plan_Launcher/LM_Launcher.h b/DAnCE/dance/Plan_Launcher/LM_Launcher.h
new file mode 100644
index 00000000000..8a569af8bed
--- /dev/null
+++ b/DAnCE/dance/Plan_Launcher/LM_Launcher.h
@@ -0,0 +1,42 @@
+/**
+ * @file EM_Launcher.h
+ * @author William R. Otte <wotte@dre.vanderbilt.edu>
+ *
+ * $Id$
+ *
+ * Plan Launcher bridge for the Locality Manager.
+ */
+
+#ifndef DANCE_PLAN_LAUNCHER_LM
+#define DANCE_PLAN_LAUNCHER_LM
+
+#include "Plan_Launcher_Base_Impl_T.h"
+
+#include "dance/DAnCE_LocalityManagerC.h"
+#include "dance/Plan_Launcher/Plan_Launcher_Export.h"
+
+namespace DAnCE
+{
+ class DAnCE_Plan_Launcher_Export LM_Launcher :
+ public virtual Plan_Launcher_Base_Impl< ::DAnCE::LocalityManager,
+ ::DAnCE::LocalityManager,
+ ::DAnCE::LocalityManager >
+ {
+ typedef Plan_Launcher_Base_Impl< ::DAnCE::LocalityManager,
+ ::DAnCE::LocalityManager,
+ ::DAnCE::LocalityManager > __Base;
+
+ public:
+ LM_Launcher (CORBA::ORB_ptr orb,
+ __Base::Manager_ptr managerw);
+
+ ~LM_Launcher (void);
+
+
+ bool lookup_by_uuid (const char *uuid,
+ CORBA::Object_out am,
+ CORBA::Object_out app);
+ };
+}
+
+#endif
diff --git a/DAnCE/dance/Plan_Launcher/Plan_Launcher.cpp b/DAnCE/dance/Plan_Launcher/Plan_Launcher.cpp
index 49937d37eaf..373d08b7ecf 100644
--- a/DAnCE/dance/Plan_Launcher/Plan_Launcher.cpp
+++ b/DAnCE/dance/Plan_Launcher/Plan_Launcher.cpp
@@ -11,6 +11,7 @@
#include "EM_Launcher.h"
#include "NM_Launcher.h"
+#include "LM_Launcher.h"
//#include "Plan_Launcher_Impl.h"
@@ -31,6 +32,7 @@ namespace
Options (void)
: em_ior_ (0),
nm_ior_ (0),
+ lm_ior_ (0),
xml_plan_ (0),
cdr_plan_ (0),
uuid_ (0),
@@ -45,6 +47,7 @@ namespace
const ACE_TCHAR *em_ior_;
const ACE_TCHAR *nm_ior_;
+ const ACE_TCHAR *lm_ior_;
const ACE_TCHAR *xml_plan_;
const ACE_TCHAR *cdr_plan_;
const ACE_TCHAR *uuid_;
@@ -67,6 +70,8 @@ usage(const ACE_TCHAR*)
ACE_TEXT ("ExecutionManager IOR for EM based deployment.\n")
ACE_TEXT ("\t-n|--nm-ior <NodeManager IOR>\t")
ACE_TEXT ("NodeManager IOR for NM based deployment.\n")
+ ACE_TEXT ("\t--lm-ior <LocalityManager IOR>\t")
+ ACE_TEXT ("LocalityManager IOR for LM based deployment.\n")
/*
ACE_TEXT ("\nName Service Options\n")
ACE_TEXT ("\t--domain-nc [NC]\t\t)
@@ -127,6 +132,7 @@ parse_args(int argc, ACE_TCHAR *argv[], Options &options)
ACE_TEXT ("k:n:c:x:u:m:a:lsfqo::h"));
get_opt.long_option(ACE_TEXT("em-ior"), 'k', ACE_Get_Opt::ARG_REQUIRED);
get_opt.long_option(ACE_TEXT("nm-ior"), 'n', ACE_Get_Opt::ARG_REQUIRED);
+ get_opt.long_option(ACE_TEXT("lm-ior"), ACE_Get_Opt::ARG_REQUIRED);
get_opt.long_option(ACE_TEXT("xml-plan"), 'x', ACE_Get_Opt::ARG_REQUIRED);
get_opt.long_option(ACE_TEXT("cdr-plan"), 'c', ACE_Get_Opt::ARG_REQUIRED);
get_opt.long_option(ACE_TEXT("plan-uuid"), 'u', ACE_Get_Opt::ARG_REQUIRED);
@@ -263,6 +269,20 @@ parse_args(int argc, ACE_TCHAR *argv[], Options &options)
case 'h':
usage (argv[0]);
return false;
+
+ case 0:
+ if (ACE_OS::strcmp (get_opt.long_option (),
+ ACE_TEXT ("lm-ior")) == 0)
+ {
+ DANCE_DEBUG (DANCE_LOG_MAJOR_DEBUG_INFO,
+ (LM_DEBUG, DLINFO
+ ACE_TEXT ("Plan_Launcher::parse_args - ")
+ ACE_TEXT ("Got LM IOR file: %C"),
+ get_opt.opt_arg ()));
+ options.lm_ior_ = get_opt.opt_arg ();
+ break;
+ }
+
default:
usage (argv[0]);
return false;
@@ -687,7 +707,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
pl_base.reset (em_pl);
}
- else
+ else if (options.nm_ior_)
{
// Resolve NM IOR for NM based deployment.
DAnCE::NM_Launcher *nm_pl (0);
@@ -703,7 +723,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
DANCE_ERROR (DANCE_LOG_EMERGENCY, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher - ")
ACE_TEXT ("Unable to resolve ")
ACE_TEXT ("NodeManager reference <%s>\n"),
- options.em_ior_));
+ options.nm_ior_));
}
return 1;
}
@@ -715,6 +735,34 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
pl_base.reset (nm_pl);
}
+ else if (options.lm_ior_)
+ {
+ // Resolve NM IOR for NM based deployment.
+ DAnCE::LM_Launcher *lm_pl (0);
+
+ CORBA::Object_var obj = orb->string_to_object (options.lm_ior_);
+ DAnCE::LocalityManager_var tmp_em =
+ DAnCE::LocalityManager::_narrow (obj);
+
+ if (CORBA::is_nil (tmp_em.in ()))
+ {
+ if (!options.quiet_)
+ {
+ DANCE_ERROR (DANCE_LOG_EMERGENCY, (LM_ERROR, DLINFO ACE_TEXT ("Plan_Launcher - ")
+ ACE_TEXT ("Unable to resolve ")
+ ACE_TEXT ("LocalityManager reference <%s>\n"),
+ options.lm_ior_));
+ }
+ return 1;
+ }
+
+ ACE_NEW_THROW_EX (lm_pl,
+ DAnCE::LM_Launcher (orb.in (),
+ tmp_em.in ()),
+ CORBA::NO_MEMORY ());
+
+ pl_base.reset (lm_pl);
+ }
Deployment::DeploymentPlan_var dp;
diff --git a/DAnCE/dance/Plan_Launcher/Plan_Launcher.mpc b/DAnCE/dance/Plan_Launcher/Plan_Launcher.mpc
index cb30e1d60df..747d3e5bf5f 100644
--- a/DAnCE/dance/Plan_Launcher/Plan_Launcher.mpc
+++ b/DAnCE/dance/Plan_Launcher/Plan_Launcher.mpc
@@ -7,20 +7,21 @@ project(DAnCE_Plan_Launcher_Impl) : install_lib, dance_lib, dance_logger, dance_
dance_domainapplicationmanager_stub, \
dance_nodeapplication_stub, \
dance_nodeapplicationmanager_stub, \
- dance_nodemanager_stub {
+ dance_nodemanager_stub, dance_stub {
dynamicflags += DANCE_PLAN_LAUNCHER_BUILD_DLL
Source_Files {
EM_Launcher.cpp
NM_Launcher.cpp
+ LM_Launcher.cpp
}
-
+
Template_Files {
Plan_Launcher_Base_Impl_T.cpp
}
}
-
+
project(Plan_Launcher_Exec) : install, dance_exe, dance_plan_launcher {
exename = dance_plan_launcher
Source_Files {
diff --git a/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp b/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp
index efedca33b27..8ac57fe3d54 100644
--- a/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp
+++ b/DAnCE/dance/Plan_Launcher/Plan_Launcher_Base_Impl_T.cpp
@@ -76,7 +76,7 @@ namespace DAnCE
typename Plan_Launcher_Base_Impl< Manager, AppManager, Application>::AppManager_var app_manager;
try
{
- app_manager = this->manager_->preparePlan (plan, 0);
+ app_manager = AppManager::_narrow (this->manager_->preparePlan (plan, 0));
}
catch (::Deployment::PlanError &ex)
{