summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-04-04 17:09:57 +0000
committernilabjar <nilabjar@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-04-04 17:09:57 +0000
commit5f2fbf0d73ba825e006a63a040af905dbb4c88a8 (patch)
treece47ef8a8f2ec9f53dda16d2eea082a2ec0dadde
parentc5b00bf91264cd9f1fc9b017112af3d871cccc03 (diff)
downloadATCD-TargetManager_Cmp.tar.gz
ChangeLogTag : Wed Apr 4 17:07:45 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.eduTargetManager_Cmp
-rw-r--r--ChangeLog35
-rw-r--r--DAnCE/TargetManager/DomainDataManager.cpp59
-rw-r--r--DAnCE/TargetManager/DomainDataManager.h16
-rw-r--r--DAnCE/TargetManager/TargetManager.mpc3
-rw-r--r--DAnCE/TargetManager/TargetManagerImpl.idl1
-rw-r--r--DAnCE/TargetManager_Ext/DomainDataManager_Ext.cpp98
-rw-r--r--DAnCE/TargetManager_Ext/DomainDataManager_Ext.h93
-rw-r--r--DAnCE/TargetManager_Ext/TM_Client_Ext.mpc26
-rw-r--r--DAnCE/TargetManager_Ext/TM_client_Ext.cpp378
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt.idl84
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl.cidl29
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl.idl29
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl.mpc80
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_export.h58
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp325
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.h186
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_stub_export.h58
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_svnt_export.h58
18 files changed, 1583 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 36bb12af2d1..eafec7656f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,41 @@
+Wed Apr 4 17:07:45 UTC 2007 Nilabja R <nilabjar@dre.vanderbilt.edu>
+
+ * DAnCE/TargetManager/DomainDataManager.h:
+ * DAnCE/TargetManager/DomainDataManager.cpp:
+ * DAnCE/TargetManager/TargetManager.mpc:
+ * DAnCE/TargetManager/TargetManagerImpl.idl:
+
+ Changes made to accomodate CIAO-specific functions
+
+ * DAnCE/TargetManager_Ext:
+
+ * DAnCE/TargetManager_Ext/DomainDataManager_Ext.h:
+ * DAnCE/TargetManager_Ext/DomainDataManager_Ext.cpp:
+ * DAnCE/TargetManager_Ext/TM_Client_Ext.mpc:
+ * DAnCE/TargetManager_Ext/TM_client_Ext.cpp:
+ * DAnCE/TargetManager_Ext/TargetManagerExt.idl:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl.cidl:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl.idl:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl.mpc:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_export.h:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.h:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl_stub_export.h:
+ * DAnCE/TargetManager_Ext/TargetManagerExt_Impl_svnt_export.h:
+
+ Added to separate CIAO-specific functionalities of TM
+
Fri Feb 23 04:08:04 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
* CIDLC/ServantGenerator.cpp:
- cidlc --help prints the following:
-
+ cidlc --help prints the following:
+
[--svnt-export-macro macro]
Replace default servant DLL export macro with provided ,acro.
- Fixed the misspelling of macro in the cidlc help message.
-
+ Fixed the misspelling of macro in the cidlc help message.
+
Thu Feb 22 22:59:01 UTC 2007 Jaiganesh B <jai.dre.vanderbilt.edu>
diff --git a/DAnCE/TargetManager/DomainDataManager.cpp b/DAnCE/TargetManager/DomainDataManager.cpp
index 69ca5d6b9c7..663171c6981 100644
--- a/DAnCE/TargetManager/DomainDataManager.cpp
+++ b/DAnCE/TargetManager/DomainDataManager.cpp
@@ -20,6 +20,17 @@ CIAO::DomainDataManager * CIAO::DomainDataManager::create (CORBA::ORB_ptr orb,
return global_data_manager_;
}
+//static DomainDataManager * CIAO::DomainDataManager::create (CORBA::ORB_ptr orb,
+// ::Deployment::TargetManagerExt_ptr target
+// )
+//{
+// if (global_data_manager_ == 0)
+// {
+// global_data_manager_ = new DomainDataManager (orb , target);
+// }
+// return global_data_manager_;
+//}
+
// Returns the pointer to the static variable
CIAO::DomainDataManager*
CIAO::DomainDataManager::get_data_manager ()
@@ -27,7 +38,6 @@ CIAO::DomainDataManager::get_data_manager ()
return global_data_manager_;
}
-
void
CIAO::DomainDataManager::delete_data_manger ()
{
@@ -35,6 +45,30 @@ CIAO::DomainDataManager::delete_data_manger ()
delete global_data_manager_;
}
+CIAO::DomainDataManager::
+DomainDataManager (CORBA::ORB_ptr orb,
+ ::Deployment::TargetManager_ptr target)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ deployment_config_ (orb_.in()),
+ target_mgr_ (::Deployment::TargetManager::_duplicate(target))
+{
+ CIAO::Config_Handlers::DD_Handler dd (domain_file_name);
+ ::Deployment::Domain* dmn = dd.domain_idl ();
+
+ if (CIAO::debug_level () > 9)
+ ::Deployment::DnC_Dump::dump (*dmn);
+
+ current_domain_ = *dmn;
+ initial_domain_ = current_domain_;
+
+ // initialize the provisioning domain
+ provisioned_data_ = initial_domain_;
+
+ update_node_status ();
+
+ call_all_node_managers ();
+}
+
int CIAO::DomainDataManager::update_domain (
const ::CORBA::StringSeq &,
const ::Deployment::Domain & domainSubset,
@@ -88,29 +122,6 @@ int CIAO::DomainDataManager::update_domain (
return 0;
}
-CIAO::DomainDataManager::
-DomainDataManager (CORBA::ORB_ptr orb,
- ::Deployment::TargetManager_ptr target)
- : orb_ (CORBA::ORB::_duplicate (orb)),
- deployment_config_ (orb_.in()),
- target_mgr_ (::Deployment::TargetManager::_duplicate(target))
-{
- CIAO::Config_Handlers::DD_Handler dd (domain_file_name);
- ::Deployment::Domain* dmn = dd.domain_idl ();
-
- if (CIAO::debug_level () > 9)
- ::Deployment::DnC_Dump::dump (*dmn);
-
- current_domain_ = *dmn;
- initial_domain_ = current_domain_;
-
- // initialize the provisioning domain
- provisioned_data_ = initial_domain_;
-
- update_node_status ();
-
- call_all_node_managers ();
-}
::Deployment::Domain* CIAO::DomainDataManager::get_current_domain ()
{
diff --git a/DAnCE/TargetManager/DomainDataManager.h b/DAnCE/TargetManager/DomainDataManager.h
index e32ba09a6d0..7669b91d9de 100644
--- a/DAnCE/TargetManager/DomainDataManager.h
+++ b/DAnCE/TargetManager/DomainDataManager.h
@@ -79,6 +79,20 @@ namespace CIAO
);
/**
+ * This function calls the constructor of the
+ * class Domain Data Manager. It is the same as the function above
+ * only the parameter TargetManagerExt_ptr is different
+ *
+ * @brief This function is called to create the Datamanager
+ * @param orb The orb pointer
+ * @param target The Target Manager Extension Object Reference
+ *
+ */
+// static DomainDataManager * create (CORBA::ORB_ptr orb,
+// ::Deployment::TargetManagerExt_ptr target
+// );
+
+ /**
* @brief Returns the static pointer to the
* data manager.
* @return DomainDataManager*
@@ -134,7 +148,7 @@ namespace CIAO
void releaseResourceAllocation (
const ::Deployment::ResourceAllocations & resources);
- private:
+ protected:
/**
* The constructor made protected so that no one can create
diff --git a/DAnCE/TargetManager/TargetManager.mpc b/DAnCE/TargetManager/TargetManager.mpc
index a4a03cca6a4..c0d7f90c77a 100644
--- a/DAnCE/TargetManager/TargetManager.mpc
+++ b/DAnCE/TargetManager/TargetManager.mpc
@@ -10,13 +10,11 @@ project(CIAO_TargetManager_stub): ciao_client_dnc, ciao_deployment_stub, ciao_no
IDL_Files {
TargetManagerImpl.idl
- TargetManagerExt.idl
DomainEvents.idl
}
Source_Files {
TargetManagerImplC.cpp
- TargetManagerExtC.cpp
DomainEventsC.cpp
}
}
@@ -40,7 +38,6 @@ project(CIAO_TargetManager_svnt) : ciao_servant_dnc, ciao_targetmanager_stub {
Source_Files {
TargetManagerEC.cpp
TargetManagerImplS.cpp
- TargetManagerExtS.cpp
TargetManager_svnt.cpp
DomainEventsS.cpp
}
diff --git a/DAnCE/TargetManager/TargetManagerImpl.idl b/DAnCE/TargetManager/TargetManagerImpl.idl
index 484b1e53d20..cdd747a4228 100644
--- a/DAnCE/TargetManager/TargetManagerImpl.idl
+++ b/DAnCE/TargetManager/TargetManagerImpl.idl
@@ -12,7 +12,6 @@
#include "ciao/Components.idl"
#include "DAnCE/Deployment/Deployment_PlanError.idl"
-#include "DAnCE/TargetManager/TargetManagerExt.idl"
#include "DAnCE/TargetManager/DomainEvents.idl"
module CIAO
diff --git a/DAnCE/TargetManager_Ext/DomainDataManager_Ext.cpp b/DAnCE/TargetManager_Ext/DomainDataManager_Ext.cpp
new file mode 100644
index 00000000000..baee536d0fb
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/DomainDataManager_Ext.cpp
@@ -0,0 +1,98 @@
+
+#include "DomainDataManager_Ext.h"
+
+
+CIAO::DomainDataManager * CIAO::DomainDataManager_Ext::create (CORBA::ORB_ptr orb,
+ ::Deployment::TargetManager_ptr target
+ )
+{
+ if (global_data_manager_ == 0)
+ {
+ global_data_manager_ = new DomainDataManager_Ext (orb , target);
+ }
+
+ return global_data_manager_;
+}
+
+CIAO::DomainDataManager_Ext
+::DomainDataManager_Ext (CORBA::ORB_ptr orb,
+ ::Deployment::TargetManager_ptr target)
+ : DomainDataManager (orb, target)
+{
+}
+
+CIAO::Host_NodeManager_seq * CIAO::DomainDataManager_Ext::get_node_managers ()
+{
+ ::CIAO::Host_NodeManager_seq* node_mgr_seq =
+ new ::CIAO::Host_NodeManager_seq ();
+ node_mgr_seq->length (initial_domain_.node.length ());
+ for (unsigned int i=0;i < initial_domain_.node.length ();i++)
+ {
+ (*node_mgr_seq)[i].host_ =
+ CORBA::string_dup (initial_domain_.node[i].name);
+ ::Deployment::NodeManager_var node_manager =
+ deployment_config_.get_node_manager (initial_domain_.node[i].name);
+ // if (node_manager.in () != 0)
+ {
+ (*node_mgr_seq)[i].node_mgr_ = ::CIAO::NodeManagerDaemon::_narrow (node_manager.in ());
+ }
+ }
+ return node_mgr_seq;
+}
+
+CIAO::Host_Infos* CIAO::DomainDataManager_Ext::get_cpu_info ()
+{
+ CIAO::Host_Infos* host_info_seq = new CIAO::Host_Infos ();
+ host_info_seq->length (current_domain_.node.length ());
+
+ for (CORBA::ULong i=0;i < current_domain_.node.length ();i++)
+ {
+ (*host_info_seq)[i].hostname =
+ CORBA::string_dup (current_domain_.node[i].name);
+
+ for (CORBA::ULong j = 0;j < current_domain_.node[i].resource.length ();j++)
+ {
+ if (!ACE_OS::strcmp(
+ current_domain_.node[i].resource[j].name,
+ "Processor"))
+ {
+ current_domain_.node[i].resource[j].property[0].value
+ >>= (*host_info_seq)[i].cpu_util;
+ CORBA::Double d;
+ current_domain_.node[i].resource[j].property[0].value
+ >>= d;
+ }
+ }
+ }
+
+ return host_info_seq;
+}
+
+CORBA::Long CIAO::DomainDataManager_Ext::get_pid (const ACE_CString& cmp)
+{
+ CORBA::Long pid;
+
+ // This is really ineffiecient this is O(n) ; searching all the nodes
+ // all the resources for a particular component.
+ // It needs to be stored in some other data structure
+
+ for (CORBA::ULong i=0;i < current_domain_.node.length ();i++)
+ {
+ for (CORBA::ULong j = 0;j < current_domain_.node[i].resource.length ();j++)
+ {
+ // The resource
+ if (!ACE_OS::strcmp(
+ current_domain_.node[i].resource[j].name,
+ "Component") &&
+ ACE_CString (current_domain_.node[i].resource[j].property[0].name) ==
+ cmp)
+ {
+ current_domain_.node[i].resource[j].property[0].value
+ >>= pid;
+ }
+ } // resources
+ }// nodes
+
+ return pid;
+}
+
diff --git a/DAnCE/TargetManager_Ext/DomainDataManager_Ext.h b/DAnCE/TargetManager_Ext/DomainDataManager_Ext.h
new file mode 100644
index 00000000000..ecfb047ba03
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/DomainDataManager_Ext.h
@@ -0,0 +1,93 @@
+
+// $Id$
+//===============================================================
+/**
+ * @file DomainDataManager_Ext.h
+ *
+ * @brief An extension to the DomainDataManager
+ *
+ * This class extends the functionality of the DomainDataManager
+ *
+ * @author Nilabja Roy nilabjar@dre.vanderbilt.edu
+ */
+//===============================================================
+#ifndef DOMAIN_DATA_MGR_EXTH
+#define DOMAIN_DATA_MGR_EXTH
+
+#include "TargetManagerExt_ImplC.h"
+#include "DAnCE/DomainApplicationManager/Deployment_Configuration.h"
+#include "DAnCE/TargetManager/DomainDataManager.h"
+
+/**
+ * @namespace CIAO
+ *
+ * @brief The main CIAO namespace
+ *
+ */
+namespace CIAO
+{
+ /**
+ * @class DomainDataManager_Ext
+ *
+ * @brief The Extension to the DomainDataManager
+ *
+ */
+ class DomainDataManager_Ext : public DomainDataManager
+ {
+
+ public :
+
+ DomainDataManager_Ext (CORBA::ORB_ptr orb,
+ ::Deployment::TargetManager_ptr target);
+
+ /**
+ * @brief This function is called to create the Datamanager
+ * @param orb The orb pointer
+ * @param target The Target Manager Object Reference
+ *
+ * This function calls the constructor of the
+ * class DomainDataManager_Ext
+ */
+ static DomainDataManager * create (CORBA::ORB_ptr orb,
+ ::Deployment::TargetManager_ptr target
+ );
+
+ /**
+ * @brief returns the sequence of node managers
+ * object reference
+ */
+ CIAO::Host_NodeManager_seq *
+ get_node_managers ();
+
+ /**
+ * @brief returns the node specific cpu utilization
+ *
+ * @return CIAO::Host_Infos*
+ */
+
+ CIAO::Host_Infos* get_cpu_info ();
+
+ /**
+ * @brief returns the pid of the component id submitted
+ * @param cmp The component id
+ *
+ * @return process id
+ */
+ CORBA::Long get_pid (const ACE_CString& cmp);
+
+ /**
+ * @brief commits the resources that are specified
+ * in the plan.
+ * @param plan ::Deployment::DeploymentPlan
+ * @exception ::Deployment::ResourceNotAvailable thrown
+ * when the resources mentioned in the plan exceeds
+ * the current resource.
+ * @exception ::Deployment::PlanError thrown if the plan has any
+ * error
+ *
+ */
+
+ };
+} // CIAO
+
+#endif
diff --git a/DAnCE/TargetManager_Ext/TM_Client_Ext.mpc b/DAnCE/TargetManager_Ext/TM_Client_Ext.mpc
new file mode 100644
index 00000000000..ce95b5530a9
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TM_Client_Ext.mpc
@@ -0,0 +1,26 @@
+// $Id$
+
+// Client.mpc,v 1.6 2005/02/18 09:07:06 jwillemsen Exp
+
+project(TMClient_Ext): ciao_client_dnc,ciao_deployment_stub, ciao_config_handlers, ciao_events_dnc, ciao_targetmanager_stub {
+
+ after += CIAO_TargetManager_Ext_stub
+
+ libs += TargetManagerExt_Impl_stub
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ TM_client_Ext.cpp
+ }
+
+ Header_Files {
+ }
+
+ Inline_Files {
+ }
+
+ Template_Files {
+ }
+}
diff --git a/DAnCE/TargetManager_Ext/TM_client_Ext.cpp b/DAnCE/TargetManager_Ext/TM_client_Ext.cpp
new file mode 100644
index 00000000000..6974df7d83d
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TM_client_Ext.cpp
@@ -0,0 +1,378 @@
+// $Id$
+/**
+ * @file CmpClient.cpp
+ *
+ * @brief This file contains a client of TargetManager.
+ *
+ * It picks up the TM ior from the Targetmanager.ior file
+ * present in the current directory, and makes the calls on the
+ * TM to getAllResources and getAvailable resources
+ */
+
+#include "DAnCE/Deployment/Deployment_DataC.h"
+#include "DAnCE/Deployment/Deployment_ResourceCommitmentManagerC.h"
+#include "TargetManagerExt_ImplC.h"
+#include "ace/streams.h"
+#include "ace/FILE_IO.h"
+#include "ace/FILE_Connector.h"
+#include "ace/FILE_Addr.h"
+#include "ace/Get_Opt.h"
+#include "Config_Handlers/DnC_Dump.h"
+
+/**
+ * TM_Tester contains the code to test the TM Component
+ */
+namespace TM_Tester
+{
+ /**
+ * writes the extracted data to file
+ */
+ void write_to_file (::Deployment::Domain domain);
+
+ /// variable contains IOR of the TM
+ const char * stringified_TM_IOR;
+
+ /// if add or delete from domain
+ bool add_to_domain = true;
+
+ /// whether to test update domain or not
+ bool call_update = false;
+
+ /// contains the host name
+ const char * host_name;
+
+ /// parses the arguments and extracts the params
+ bool parse_args (int argc, char *argv[])
+ {
+ ACE_Get_Opt get_opts (argc, argv, "t:u:d");
+ int c;
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 't':
+ stringified_TM_IOR = get_opts.opt_arg ();
+ break;
+ case 'u':
+ host_name = get_opts.opt_arg ();
+ call_update = true;
+ break;
+ case 'd':
+ add_to_domain = false;
+ break;
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s\n"
+ "-t <TM_IOR>\n"
+ "-u <host_name in update>\n"
+ "-n <delete , default add>\n"
+ "\n",
+ argv [0]),
+ false);
+ }
+
+ return true;
+ }
+}
+
+ /// The main function
+ int main (int argc, char* argv[])
+ {
+ try {
+ // First initialize the ORB, that will remove some arguments...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv,
+ "" /* the ORB name, it can be anything! */);
+
+ if (!TM_Tester::parse_args (argc, argv))
+ return -1;
+
+ // Use the first argument to create the factory object reference,
+ // in real applications we use the naming service, but let's do
+ // the easy part first!
+ CORBA::Object_var factory_object =
+ orb->string_to_object (TM_Tester::stringified_TM_IOR);
+
+ // Now downcast the object reference to the appropriate type
+ CIAO::TargetManagerExt_Impl_var targetCmp =
+ CIAO::TargetManagerExt_Impl::_narrow (factory_object.in ());
+
+ // Now get the facet reference from the target Manager Component
+ Deployment::TargetManager_ptr targetI = targetCmp->provide_targetMgr ();
+
+
+ // Now get the facet reference from the target Manager Extension Component
+ CIAO::TargetManagerExt_ptr targetI_ext = targetCmp->provide_targetMgr_ext ();
+
+ // Now make calls on the Target Manager facet
+
+ try
+ {
+ Deployment::Domain_var domainV = targetI->getAllResources ();
+ ::Deployment::DnC_Dump::dump (domainV);
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR ,"Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception & ex)
+ {
+ ACE_ERROR ((LM_ERROR ,"Error:TargetManager:CORBA Generic Exception \n"));
+ ex._tao_print_exception ("Call to getAllResources\t\n");
+ ACE_ERROR ((LM_ERROR ,"Error:TargetManager:Exception in TargetManager call\n"));
+ }
+
+
+ // make a call to the commit resources .....
+
+ bool resource_available = true;
+
+ ::Deployment::ResourceAllocations resource_seq;
+
+ resource_seq.length (1);
+
+ resource_seq[0].elementName = CORBA::string_dup ("TargetManagerNode_1");
+
+ resource_seq[0].resourceName = CORBA::string_dup ("Processor");
+
+ resource_seq[0].property.length (1);
+ resource_seq[0].property[0].name =
+ CORBA::string_dup ("LoadAverage");
+
+ CORBA::Long d = 20;
+ resource_seq[0].property[0].value <<= d;
+
+ ::Deployment::ResourceCommitmentManager_ptr manager =
+ ::Deployment::ResourceCommitmentManager::_nil ();
+
+ try
+ {
+ manager = targetI->createResourceCommitment (resource_seq);
+
+ manager->commitResources (resource_seq);
+
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch (::Deployment::ResourceCommitmentFailure& e)
+ {
+ resource_available = 0;
+ ACE_ERROR ((LM_ERROR, "TargetManager commitResources ResourceCommitmentFailure Exception\n"));
+
+ ACE_ERROR ((LM_ERROR ,
+ "ResourceCommitmentFailure\n reason=[%s]\n elementName=[%s]\n resourceName=[%s]\n propertyName=[%s]\n",
+ e.reason.in (),
+ resource_seq[e.index].elementName.in (),
+ resource_seq[e.index].resourceName.in (),
+ e.propertyName.in ()));
+ }
+ catch(const CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:commitResources Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA Generic Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:Exception in TargetManager call"));
+ }
+
+ // Make a call to release resources , if resource < 0
+ try
+ {
+ {
+ d = 10;
+ resource_seq[0].property[0].value <<= d;
+ manager->releaseResources (resource_seq);
+ }
+ }
+ catch(const CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch (const Deployment::ResourceCommitmentFailure&)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager releaseResources ResourceNotAvailable Exception\n"));
+ }
+ catch(const CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:releaseResources Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA Generic Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:Exception in TargetManager call"));
+ }
+
+ // Here make a call on the TM with update domain and node deletion
+
+ ::Deployment::Domain updated;
+ updated.node.length (1);
+ updated.node[0].name = CORBA::string_dup (TM_Tester::host_name);
+
+ ::CORBA::StringSeq elements;
+ elements.length (0);
+
+
+ if (TM_Tester::call_update)
+ {
+ if (TM_Tester::add_to_domain)
+ {
+ try
+ {
+ targetI->updateDomain (elements , updated, ::Deployment::Add);
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA Generic Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:Exception in UpdateDomain call"));
+ }
+ }
+ else
+ {
+ try
+ {
+ targetI->updateDomain (elements , updated, ::Deployment::Delete);
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA Generic Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:Exception in UpdateDomain call"));
+ }
+ }
+ }
+
+ // Now make a call of getAvailableResources on the TargetManager ...
+ try
+ {
+ Deployment::Domain_var domainV = targetI->getAvailableResources();
+
+ // here write things to file ...
+ TM_Tester::write_to_file (domainV.in());
+
+ ::Deployment::DnC_Dump::dump (domainV);
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR ,"Error:TargetManager:CORBA Generic Exception\n"));
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:Exception in TargetManager call\n"));
+ }
+
+
+/// Here test the functionality of the CIAO-specific tasks .....
+
+ try
+ {
+ ::CIAO::Host_Infos_var hostv = targetI_ext ->get_host_cpu ();
+
+ for (CORBA::ULong i = 0; i < hostv->length ();i++)
+ {
+ ACE_DEBUG ((LM_DEBUG , "The host [%s] takes [%d] cpu \n",
+ hostv[i].hostname.in (),
+ hostv[i].cpu_util
+ ));
+ }
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception & ex)
+ {
+ ex._tao_print_exception ("GET_HOST_CPU::\t\n");
+ }
+
+ try
+ {
+
+ ::CIAO::Host_NodeManager_seq_var nodes = targetI_ext->get_all_node_managers ();
+
+ for (CORBA::ULong i = 0; i < nodes->length ();i++)
+ {
+ ACE_DEBUG ((LM_DEBUG , "The host [%s] has Node Mgr [%s] \n",
+ nodes[i].host_.in (),
+ orb->object_to_string (nodes[i].node_mgr_)
+ ));
+ }
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception & ex)
+ {
+ ex._tao_print_exception ("GET_HOST_CPU::\t\n");
+ }
+
+ try
+ {
+
+ CORBA::Long pid = targetI_ext->get_pid ("TargetManager-idd");
+
+ ACE_DEBUG ((LM_DEBUG , "The pid of the component is [%d] \n",
+ pid));
+ }
+ catch(CORBA::NO_IMPLEMENT &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA::NO_IMPLEMENT thrown\n"));
+ }
+ catch(CORBA::Exception & ex)
+ {
+ ex._tao_print_exception ("GET_HOST_CPU::\t\n");
+ }
+ // Finally destroy the ORB
+ orb->destroy ();
+ }
+ catch (CORBA::Exception &)
+ {
+ ACE_ERROR ((LM_ERROR, "Error:TargetManager:CORBA exception raised!\n"));
+ }
+ return 0;
+ }
+
+namespace TM_Tester
+{
+ void write_to_file (::Deployment::Domain domain)
+ {
+ for (size_t i = 0;i < domain.node.length ();i++)
+ {
+ std::ofstream out (domain.node[i].name.in ());
+
+
+ // write in the node usage ...
+ for (size_t j = 0;j < domain.node[i].resource.length ();j++)
+ {
+
+ if (!strcmp (domain.node[i].resource[j].name.in (), "Processor"))
+ {
+ CORBA::Double node_cpu;
+ domain.node[i].resource[j].property[0].value >>= node_cpu;
+ out << node_cpu << std::endl;
+ }
+ if (!strcmp (domain.node[i].resource[j].name.in (), "NA_Monitor"))
+ {
+ std::string file_name = "NA_";
+ file_name += domain.node[i].name.in ();
+ ACE_FILE_IO file_io;
+ ACE_FILE_Connector (file_io, ACE_FILE_Addr (file_name.c_str ()));
+ CORBA::Double na_node_cpu;
+ domain.node[i].resource[j].property[0].value >>= na_node_cpu;
+ char buf[BUFSIZ];
+ memset (buf , 0 , BUFSIZ);
+ ACE_OS::sprintf (buf , "%f", na_node_cpu);
+ file_io.send (buf, ACE_OS::strlen (buf));
+ }
+ }
+
+ out.close ();
+ }
+
+ }
+}
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt.idl b/DAnCE/TargetManager_Ext/TargetManagerExt.idl
new file mode 100644
index 00000000000..26d0c336b62
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt.idl
@@ -0,0 +1,84 @@
+// $Id$
+
+/**
+ * @file TargetManagerExt.idl
+ *
+ * @brief The Extensions to the TM interface for ARMS demo
+ *
+ * @author Nilabja R <nilabjar@dre.vanderbilt.edu>
+ * @author Nishanth Shankaran <nshankar@dre.vanderbilt.edu>
+ *
+ * This file declares a interface which will be implemented as
+ * a facet by the TargetManager component
+ */
+
+#include "DAnCE/Interfaces/NodeManagerDaemon.idl"
+
+module CIAO
+{
+ /**
+ * @struct Cpu_Info
+ * @brief Consists of individual host-cpu info
+ */
+ struct Host_Info
+ {
+ string hostname;
+ double cpu_util;
+ };
+
+ /// The sequence of CPU infos
+ typedef sequence<Host_Info> Host_Infos;
+
+ /**
+ * @struct Component_Cpu_Util
+ * @brief Contains a component CPU Util
+ */
+ struct Component_Info
+ {
+ string component_name;
+ double cpu_util;
+ };
+
+ /// The sequence of component cpu utilization
+ typedef sequence <Component_Info> Component_Infos;
+
+
+ /**
+ * @struct Host_NodeManager
+ * @brief Contains the node manager to host reference
+ */
+ struct Host_NodeManager
+ {
+ /// host name
+ string host_;
+
+ /// the node manager IOR
+ ::CIAO::NodeManagerDaemon node_mgr_;
+ };
+
+ /// Sequence of NodeManager.
+ typedef sequence <Host_NodeManager> Host_NodeManager_seq;
+
+ /**
+ * @interface TargetManagerExt
+ * @brief The Target Manager Extension
+ *
+ * Contains the interface used by the RACE
+ * controller.
+ */
+ interface TargetManagerExt
+ {
+ ///Returns the pid in which a component runs
+ long get_pid (in string component_uuid);
+
+ /// returns the cpu usage for each host in the
+ /// last cycle
+ Host_Infos get_host_cpu ();
+
+ /// Return the detail of the components
+ Component_Infos get_component_cpu ();
+
+ /// Returns the OR of the Node managers
+ Host_NodeManager_seq get_all_node_managers ();
+ };
+};
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.cidl b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.cidl
new file mode 100644
index 00000000000..293d52a8194
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.cidl
@@ -0,0 +1,29 @@
+// $Id$
+
+/*
+ * @file TargetManager_Ext.cidl
+ * @brief The file contains the TargetManager Extension component
+ * defination
+ */
+
+#ifndef TARGETMANAGER_EXT_CIDL
+#define TARGETMANAGER_EXT_CIDL
+
+#include "TargetManagerExt_Impl.idl"
+
+/*
+ * @composition TargetManager_Ext_i
+ */
+
+
+composition session TargetManager_Ext_i
+{
+ home executor TargetManagerExt_Home_Exec
+ {
+ implements CIAO::TargetManagerExt_Home;
+ manages TargetManagerExt_Impl_Exec;
+ };
+};
+
+#endif
+
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.idl b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.idl
new file mode 100644
index 00000000000..01b3a0c5de4
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.idl
@@ -0,0 +1,29 @@
+//$Id$
+
+/**
+ * @file TargetManagerExt_Impl.idl
+ * @brief TargetManagerExt Component defination
+ *
+ * @author Nilabja Roy nilabjar@dre.vanderbilt.edu
+ */
+
+#ifndef TARGETMANAGER_EXT__IDL
+#define TARGETMANAGER_EXT_IDL
+
+#include "DAnCE/TargetManager/TargetManagerImpl.idl"
+#include "TargetManagerExt.idl"
+
+module CIAO
+{
+ component TargetManagerExt_Impl : TargetManagerImpl
+ {
+ provides CIAO::TargetManagerExt targetMgr_ext;
+ };
+
+
+ home TargetManagerExt_Home manages TargetManagerExt_Impl
+ {
+ };
+
+};
+#endif
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.mpc b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.mpc
new file mode 100644
index 00000000000..1f773768538
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl.mpc
@@ -0,0 +1,80 @@
+// $Id$
+// This file is generated with "generate_component_mpc.pl -p TargetManagerImpl TargetManagerExt_Impl"
+
+project(CIAO_TargetManager_Ext_stub): ciao_client_dnc {
+ after += TargetManagerImpl_stub
+ sharedname = TargetManagerExt_Impl_stub
+
+ idlflags -= -GT
+ idlflags += -St \
+ -Wb,stub_export_macro=TARGETMANAGEREXT_IMPL_STUB_Export \
+ -Wb,stub_export_include=TargetManagerExt_Impl_stub_export.h \
+ -Wb,skel_export_macro=TARGETMANAGEREXT_IMPL_SVNT_Export \
+ -Wb,skel_export_include=TargetManagerExt_Impl_svnt_export.h
+
+ dynamicflags = TARGETMANAGEREXT_IMPL_STUB_BUILD_DLL
+
+ includes += $CIAO_ROOT/DAnCE/TargetManager
+
+ IDL_Files {
+ TargetManagerExt_Impl.idl
+ TargetManagerExt.idl
+ }
+
+ Source_Files {
+ TargetManagerExtC.cpp
+ TargetManagerExt_ImplC.cpp
+ }
+}
+
+project(CIAO_TargetManager_Ext_svnt) : ciao_servant_dnc {
+ after += TargetManagerImpl_skel CIAO_TargetManager_Ext_stub
+ sharedname = TargetManagerExt_Impl_svnt
+ libs += TargetManagerExt_Impl_stub TargetManager_stub TargetManager_svnt
+
+ idlflags -= -GT
+ idlflags += -St -SS \
+ -Wb,export_macro=TARGETMANAGEREXT_IMPL_SVNT_Export \
+ -Wb,export_include=TargetManagerExt_Impl_svnt_export.h
+
+ dynamicflags = TARGETMANAGEREXT_IMPL_SVNT_BUILD_DLL
+
+ CIDL_Files {
+ TargetManagerExt_Impl.cidl
+ }
+
+ IDL_Files {
+ TargetManagerExt_ImplE.idl
+ }
+
+ Source_Files {
+ TargetManagerExtS.cpp
+ TargetManagerExt_ImplS.cpp
+ TargetManagerExt_Impl_svnt.cpp
+ }
+}
+
+project(TargetManagerImpl_TargetManagerExt_Impl_exec) : ciao_component_dnc, ciao_config_handlers, ciao_domainapplicationmanager_dnc {
+ after += CIAO_TargetManager_Ext_svnt
+ sharedname = TargetManagerExt_Impl_exec
+ libs += TargetManagerExt_Impl_stub TargetManagerExt_Impl_svnt TargetManager_stub TargetManager_svnt
+
+ dynamicflags = TARGETMANAGEREXT_IMPL_EXEC_BUILD_DLL
+
+ includes += $CIAO_ROOT/DAnCE/TargetManager
+
+ IDL_Files {
+
+ }
+
+ Source_Files {
+
+ TargetManagerExt_Impl_exec_i.cpp
+ $(CIAO_ROOT)/DAnCE/TargetManager/ResourceCommitmentManager.cpp
+ $(CIAO_ROOT)/DAnCE/TargetManager/DomainDataManager.cpp
+ DomainDataManager_Ext.cpp
+ }
+}
+
+
+
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_export.h b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_export.h
new file mode 100644
index 00000000000..79948933931
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TARGETMANAGEREXT_IMPL_EXEC
+// ------------------------------
+#ifndef TARGETMANAGEREXT_IMPL_EXEC_EXPORT_H
+#define TARGETMANAGEREXT_IMPL_EXEC_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL */
+
+#if !defined (TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL 1
+#endif /* ! TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL */
+
+#if defined (TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL) && (TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL == 1)
+# if defined (TARGETMANAGEREXT_IMPL_EXEC_BUILD_DLL)
+# define TARGETMANAGEREXT_IMPL_EXEC_Export ACE_Proper_Export_Flag
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TARGETMANAGEREXT_IMPL_EXEC_BUILD_DLL */
+# define TARGETMANAGEREXT_IMPL_EXEC_Export ACE_Proper_Import_Flag
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TARGETMANAGEREXT_IMPL_EXEC_BUILD_DLL */
+#else /* TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL == 1 */
+# define TARGETMANAGEREXT_IMPL_EXEC_Export
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARATION(T)
+# define TARGETMANAGEREXT_IMPL_EXEC_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TARGETMANAGEREXT_IMPL_EXEC_HAS_DLL == 1 */
+
+// Set TARGETMANAGEREXT_IMPL_EXEC_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TARGETMANAGEREXT_IMPL_EXEC_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_EXEC_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TARGETMANAGEREXT_IMPL_EXEC_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TARGETMANAGEREXT_IMPL_EXEC_NTRACE */
+
+#if (TARGETMANAGEREXT_IMPL_EXEC_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_EXEC_TRACE(X)
+#else /* (TARGETMANAGEREXT_IMPL_EXEC_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TARGETMANAGEREXT_IMPL_EXEC_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TARGETMANAGEREXT_IMPL_EXEC_NTRACE == 1) */
+
+#endif /* TARGETMANAGEREXT_IMPL_EXEC_EXPORT_H */
+
+// End of auto generated file.
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp
new file mode 100644
index 00000000000..69191b6ba8f
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp
@@ -0,0 +1,325 @@
+// $Id$
+//
+// **** Code generated by the ****
+// **** Component Integrated ACE ORB (CIAO) CIDL Compiler ****
+// CIAO has been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// CIDL Compiler has been developed by:
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about CIAO is available at:
+// http://www.dre.vanderbilt.edu/CIAO
+
+#include "TargetManagerExt_Impl_exec_i.h"
+#include "ciao/CIAO_common.h"
+#include "DomainDataManager_Ext.h"
+#include "DAnCE/TargetManager/ResourceCommitmentManager.h"
+
+namespace CIDL_TargetManager_Ext_i
+{
+ //==================================================================
+ // Facet Executor Implementation Class: TargetManager_exec_i
+ //==================================================================
+
+ TargetManager_exec_i::
+ TargetManager_exec_i (TargetManagerExt_Impl_exec_i* exec ,
+ CORBA::ORB_ptr orb,
+ TargetManagerExt_Impl_Context *context)
+ : _exec (exec),
+ orb_ (CORBA::ORB::_duplicate (orb)),
+ context_ (context)
+ {
+ // The DomainDataManager created here ...
+
+ // get its own obj ref , then call
+
+ CORBA::Object_var object = context_->get_CCM_object ();
+ CIAO::TargetManagerExt_Impl_var target_impl =
+ CIAO::TargetManagerExt_Impl::_narrow (object.in ());
+ ::Deployment::TargetManager_var target =
+ target_impl->provide_targetMgr ();
+
+ // Create Domain Data here
+
+ CIAO::DomainDataManager_Ext::create (orb_.in (), target.in ());
+// CIAO::Domain_Singleton::instance ();
+ }
+
+ TargetManager_exec_i::~TargetManager_exec_i (void)
+ {
+ }
+
+ // Operations from ::Deployment::TargetManager
+
+ ::Deployment::Domain *
+ TargetManager_exec_i::getAllResources ()
+ {
+ ACE_DEBUG ((LM_DEBUG, "Inside getAllResourcesn"));
+ return CIAO::DomainDataManager::
+ get_data_manager ()->get_initial_domain ();
+ }
+
+ ::Deployment::Domain *
+ TargetManager_exec_i::getAvailableResources ()
+ {
+ return CIAO::DomainDataManager::
+ get_data_manager ()->get_current_domain ();
+ }
+
+ ::Deployment::ResourceCommitmentManager_ptr
+ TargetManager_exec_i::createResourceCommitment (
+ const ::Deployment::ResourceAllocations & manager
+ )
+ {
+ CIAO::ResourceCommitmentManager_i *commit_servant =
+ new CIAO::ResourceCommitmentManager_i ();
+
+ // Standard owner transfer mechanisms.
+ //
+ PortableServer::ServantBase_var safe_daemon (commit_servant);
+
+ commit_servant->commitResources (manager);
+
+ Deployment::ResourceCommitmentManager_var mgrv =
+ commit_servant->_this ();
+
+ return mgrv._retn ();
+ }
+
+ void
+ TargetManager_exec_i::destroyResourceCommitment (
+ ::Deployment::ResourceCommitmentManager_ptr resources
+ )
+ {
+ ::Deployment::ResourceAllocations res;
+ res.length (0);
+ resources->releaseResources (res);
+ return;
+ }
+
+ void
+ TargetManager_exec_i::updateDomain (
+ const ::CORBA::StringSeq & elements ,
+ const ::Deployment::Domain & domainSubset ,
+ ::Deployment::DomainUpdateKind updateKind
+ )
+ {
+ CIAO::DomainDataManager::
+ get_data_manager ()->update_domain (
+ elements,
+ domainSubset,
+ updateKind);
+
+ // here tell the planner about the changes
+
+ // first get the node names which have failed ...
+ // assuming nodes to only fail , for now
+
+ if (updateKind == ::Deployment::Delete ||
+ updateKind == ::Deployment::Add)
+ {
+ CIAO::Domain_Changed_Event_var changed_event =
+ new OBV_CIAO::Domain_Changed_Event ();
+
+ ::Deployment::Domain_var temp_domain =
+ new ::Deployment::Domain (domainSubset);
+
+ changed_event->changes (temp_domain);
+ changed_event->change_kind (updateKind);
+
+ context_->push_changes (changed_event);
+ }
+ }
+
+ //==================================================================
+ // Facet Executor Implementation Class: TargetManagerExt_exec_i
+ //==================================================================
+
+ TargetManagerExt_exec_i::TargetManagerExt_exec_i (void)
+ {
+ }
+
+ TargetManagerExt_exec_i::~TargetManagerExt_exec_i (void)
+ {
+ }
+
+ // Operations from ::CIAO::TargetManagerExt
+
+ ::CORBA::Long
+ TargetManagerExt_exec_i::get_pid (
+ const char * component_uuid
+ )
+ {
+ return ((CIAO::DomainDataManager_Ext*)CIAO::DomainDataManager_Ext::
+ get_data_manager ())->get_pid (component_uuid);
+ }
+
+ ::CIAO::Host_Infos *
+ TargetManagerExt_exec_i::get_host_cpu ()
+ {
+ return ((CIAO::DomainDataManager_Ext*)CIAO::DomainDataManager_Ext::
+ get_data_manager ())->get_cpu_info ();
+ }
+
+ ::CIAO::Component_Infos *
+ TargetManagerExt_exec_i::get_component_cpu ()
+ {
+ // Your code here.
+ return 0;
+ }
+
+ ::CIAO::Host_NodeManager_seq *
+ TargetManagerExt_exec_i::get_all_node_managers ()
+ {
+ return ((CIAO::DomainDataManager_Ext*)CIAO::DomainDataManager_Ext::
+ get_data_manager ())->get_node_managers ();
+ }
+
+ //==================================================================
+ // Component Executor Implementation Class: TargetManagerExt_Impl_exec_i
+ //==================================================================
+
+ TargetManagerExt_Impl_exec_i::TargetManagerExt_Impl_exec_i (void)
+ {
+ }
+
+ TargetManagerExt_Impl_exec_i::~TargetManagerExt_Impl_exec_i (void)
+ {
+ }
+
+ // Supported or inherited operations.
+
+ // Attribute operations.
+
+ // Port operations.
+
+ ::Deployment::CCM_TargetManager_ptr
+ TargetManagerExt_Impl_exec_i::get_targetMgr ()
+ {
+ if (CORBA::is_nil (this->exec_object_.in ()))
+ {
+ this->exec_object_ = new TargetManager_exec_i(this,
+ context_->_ciao_the_Container()->the_ORB(),
+ context_);
+ }
+
+ return ::Deployment::CCM_TargetManager::_duplicate (this->exec_object_.in ());
+ }
+
+ ::CIAO::CCM_TargetManagerExt_ptr
+ TargetManagerExt_Impl_exec_i::get_targetMgr_ext ()
+ {
+ if (CORBA::is_nil (this->ext_exec_object_.in ()))
+ {
+ this->ext_exec_object_ = new TargetManagerExt_exec_i ();
+ }
+
+ return ::CIAO::CCM_TargetManagerExt::_duplicate (this->ext_exec_object_.in ());
+ }
+
+ // Operations from Components::SessionComponent
+
+ void
+ TargetManagerExt_Impl_exec_i::set_session_context (
+ ::Components::SessionContext_ptr ctx)
+ {
+ this->context_ =
+ TargetManagerExt_Impl_Context::_narrow (
+ ctx
+ );
+
+ if (this->context_ == 0)
+ {
+ throw ::CORBA::INTERNAL ();
+ }
+ }
+
+ void
+ TargetManagerExt_Impl_exec_i::ciao_preactivate ()
+ {
+ // Your code here.
+ }
+
+ void
+ TargetManagerExt_Impl_exec_i::ciao_postactivate ()
+ {
+ // Your code here.
+ }
+
+ void
+ TargetManagerExt_Impl_exec_i::ccm_activate ()
+ {
+ // Your code here.
+ }
+
+ void
+ TargetManagerExt_Impl_exec_i::ccm_passivate ()
+ {
+ // Your code here.
+ }
+
+ void
+ TargetManagerExt_Impl_exec_i::ccm_remove ()
+ {
+ // Your code here.
+ }
+
+ //==================================================================
+ // Home Executor Implementation Class: TargetManagerExt_Home_exec_i
+ //==================================================================
+
+ TargetManagerExt_Home_exec_i::TargetManagerExt_Home_exec_i (void)
+ {
+ }
+
+ TargetManagerExt_Home_exec_i::~TargetManagerExt_Home_exec_i (void)
+ {
+ }
+
+ // Supported or inherited operations.
+
+ // Home operations.
+
+ // Factory and finder operations.
+
+ // Attribute operations.
+
+ // Implicit operations.
+
+ ::Components::EnterpriseComponent_ptr
+ TargetManagerExt_Home_exec_i::create ()
+ {
+ ::Components::EnterpriseComponent_ptr retval =
+ ::Components::EnterpriseComponent::_nil ();
+
+ ACE_NEW_THROW_EX (
+ retval,
+ TargetManagerExt_Impl_exec_i,
+ ::CORBA::NO_MEMORY ());
+
+ return retval;
+ }
+
+ extern "C" TARGETMANAGEREXT_IMPL_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_CIAO_TargetManagerExt_Home_Impl (void)
+ {
+ ::Components::HomeExecutorBase_ptr retval =
+ ::Components::HomeExecutorBase::_nil ();
+
+ ACE_NEW_RETURN (
+ retval,
+ TargetManagerExt_Home_exec_i,
+ ::Components::HomeExecutorBase::_nil ());
+
+ return retval;
+ }
+}
+
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.h b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.h
new file mode 100644
index 00000000000..3b6c93d90b6
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.h
@@ -0,0 +1,186 @@
+// $Id$
+//
+// **** Code generated by the ****
+// **** Component Integrated ACE ORB (CIAO) CIDL Compiler ****
+// CIAO has been developed by:
+// Center for Distributed Object Computing
+// Washington University
+// St. Louis, MO
+// USA
+// http://www.cs.wustl.edu/~schmidt/doc-center.html
+// CIDL Compiler has been developed by:
+// Institute for Software Integrated Systems
+// Vanderbilt University
+// Nashville, TN
+// USA
+// http://www.isis.vanderbilt.edu/
+//
+// Information about CIAO is available at:
+// http://www.dre.vanderbilt.edu/CIAO
+
+#ifndef CIAO_TARGETMANAGEREXT_IMPL_EXEC_H
+#define CIAO_TARGETMANAGEREXT_IMPL_EXEC_H
+
+#include /**/ "ace/pre.h"
+
+#include "TargetManagerExt_Impl_svnt.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "TargetManagerExt_Impl_exec_export.h"
+#include "tao/LocalObject.h"
+
+namespace CIDL_TargetManager_Ext_i
+{
+
+ class TargetManagerExt_Impl_Context;
+
+ class TARGETMANAGEREXT_IMPL_EXEC_Export TargetManagerExt_Impl_exec_i
+ : public virtual TargetManagerExt_Impl_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ TargetManagerExt_Impl_exec_i (void);
+ virtual ~TargetManagerExt_Impl_exec_i (void);
+
+ // Supported or inherited operations.
+
+ // Attribute operations.
+
+ // Port operations.
+
+ virtual ::Deployment::CCM_TargetManager_ptr
+ get_targetMgr (
+ );
+
+ virtual ::CIAO::CCM_TargetManagerExt_ptr
+ get_targetMgr_ext (
+ );
+
+ // Operations from Components::SessionComponent
+
+ virtual void
+ set_session_context (
+ ::Components::SessionContext_ptr ctx);
+
+ virtual void ciao_preactivate ();
+
+ virtual void ciao_postactivate ();
+
+ virtual void ccm_activate ();
+
+ virtual void ccm_passivate ();
+
+ virtual void ccm_remove ();
+
+ protected:
+ /// The context pointer
+ TargetManagerExt_Impl_Context *context_;
+
+ /// The executor for the spec defined interface
+ ::Deployment::CCM_TargetManager_var exec_object_;
+
+ // The interface to the CIAO-specific extensions ...
+ ::CIAO::CCM_TargetManagerExt_var ext_exec_object_;
+ };
+
+ class TARGETMANAGEREXT_IMPL_EXEC_Export TargetManager_exec_i
+ : public virtual ::Deployment::CCM_TargetManager,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ TargetManager_exec_i (TargetManagerExt_Impl_exec_i* exec,
+ CORBA::ORB_ptr orb,
+ TargetManagerExt_Impl_Context *context);
+
+ virtual ~TargetManager_exec_i (void);
+
+ // Operations from ::Deployment::TargetManager
+
+ virtual ::Deployment::Domain *
+ getAllResources ();
+
+ virtual ::Deployment::Domain *
+ getAvailableResources ();
+
+ virtual ::Deployment::ResourceCommitmentManager_ptr
+ createResourceCommitment (
+ const ::Deployment::ResourceAllocations & resources
+ );
+
+ virtual void
+ destroyResourceCommitment (
+ ::Deployment::ResourceCommitmentManager_ptr manager
+ );
+
+ virtual void
+ updateDomain (
+ const ::CORBA::StringSeq & elements,
+ const ::Deployment::Domain & domainSubset,
+ ::Deployment::DomainUpdateKind updateKind
+ );
+
+ private:
+ TargetManagerExt_Impl_exec_i* _exec;
+ CORBA::ORB_var orb_;
+ /// The context object ...
+ TargetManagerExt_Impl_Context *context_;
+ };
+
+ class TARGETMANAGEREXT_IMPL_EXEC_Export TargetManagerExt_exec_i
+ : public virtual ::CIAO::CCM_TargetManagerExt,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ TargetManagerExt_exec_i (void);
+ virtual ~TargetManagerExt_exec_i (void);
+
+ // Operations from ::CIAO::TargetManagerExt
+
+ virtual ::CORBA::Long
+ get_pid (
+ const char * component_uuid
+ );
+
+ virtual ::CIAO::Host_Infos *
+ get_host_cpu ();
+
+ virtual ::CIAO::Component_Infos *
+ get_component_cpu ();
+
+ virtual ::CIAO::Host_NodeManager_seq *
+ get_all_node_managers ();
+ };
+
+ class TARGETMANAGEREXT_IMPL_EXEC_Export TargetManagerExt_Home_exec_i
+ : public virtual TargetManagerExt_Home_Exec,
+ public virtual TAO_Local_RefCounted_Object
+ {
+ public:
+ TargetManagerExt_Home_exec_i (void);
+ virtual ~TargetManagerExt_Home_exec_i (void);
+
+ // Supported or inherited operations.
+
+ // Home operations.
+
+ // Factory and finder operations.
+
+ // Attribute operations.
+
+ // Implicit operations.
+
+ virtual ::Components::EnterpriseComponent_ptr
+ create ();
+ };
+
+ extern "C" TARGETMANAGEREXT_IMPL_EXEC_Export ::Components::HomeExecutorBase_ptr
+ create_CIAO_TargetManagerExt_Home_Impl (void);
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* CIAO_TARGETMANAGEREXT_IMPL_EXEC_H */
+
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_stub_export.h b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_stub_export.h
new file mode 100644
index 00000000000..62113787e2b
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_stub_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TARGETMANAGEREXT_IMPL_STUB
+// ------------------------------
+#ifndef TARGETMANAGEREXT_IMPL_STUB_EXPORT_H
+#define TARGETMANAGEREXT_IMPL_STUB_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TARGETMANAGEREXT_IMPL_STUB_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_STUB_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TARGETMANAGEREXT_IMPL_STUB_HAS_DLL */
+
+#if !defined (TARGETMANAGEREXT_IMPL_STUB_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_STUB_HAS_DLL 1
+#endif /* ! TARGETMANAGEREXT_IMPL_STUB_HAS_DLL */
+
+#if defined (TARGETMANAGEREXT_IMPL_STUB_HAS_DLL) && (TARGETMANAGEREXT_IMPL_STUB_HAS_DLL == 1)
+# if defined (TARGETMANAGEREXT_IMPL_STUB_BUILD_DLL)
+# define TARGETMANAGEREXT_IMPL_STUB_Export ACE_Proper_Export_Flag
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TARGETMANAGEREXT_IMPL_STUB_BUILD_DLL */
+# define TARGETMANAGEREXT_IMPL_STUB_Export ACE_Proper_Import_Flag
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TARGETMANAGEREXT_IMPL_STUB_BUILD_DLL */
+#else /* TARGETMANAGEREXT_IMPL_STUB_HAS_DLL == 1 */
+# define TARGETMANAGEREXT_IMPL_STUB_Export
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARATION(T)
+# define TARGETMANAGEREXT_IMPL_STUB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TARGETMANAGEREXT_IMPL_STUB_HAS_DLL == 1 */
+
+// Set TARGETMANAGEREXT_IMPL_STUB_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TARGETMANAGEREXT_IMPL_STUB_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_STUB_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TARGETMANAGEREXT_IMPL_STUB_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TARGETMANAGEREXT_IMPL_STUB_NTRACE */
+
+#if (TARGETMANAGEREXT_IMPL_STUB_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_STUB_TRACE(X)
+#else /* (TARGETMANAGEREXT_IMPL_STUB_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TARGETMANAGEREXT_IMPL_STUB_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TARGETMANAGEREXT_IMPL_STUB_NTRACE == 1) */
+
+#endif /* TARGETMANAGEREXT_IMPL_STUB_EXPORT_H */
+
+// End of auto generated file.
diff --git a/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_svnt_export.h b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_svnt_export.h
new file mode 100644
index 00000000000..4128fe54e77
--- /dev/null
+++ b/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_svnt_export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl TARGETMANAGEREXT_IMPL_SVNT
+// ------------------------------
+#ifndef TARGETMANAGEREXT_IMPL_SVNT_EXPORT_H
+#define TARGETMANAGEREXT_IMPL_SVNT_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL */
+
+#if !defined (TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL)
+# define TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL 1
+#endif /* ! TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL */
+
+#if defined (TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL) && (TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL == 1)
+# if defined (TARGETMANAGEREXT_IMPL_SVNT_BUILD_DLL)
+# define TARGETMANAGEREXT_IMPL_SVNT_Export ACE_Proper_Export_Flag
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TARGETMANAGEREXT_IMPL_SVNT_BUILD_DLL */
+# define TARGETMANAGEREXT_IMPL_SVNT_Export ACE_Proper_Import_Flag
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TARGETMANAGEREXT_IMPL_SVNT_BUILD_DLL */
+#else /* TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL == 1 */
+# define TARGETMANAGEREXT_IMPL_SVNT_Export
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARATION(T)
+# define TARGETMANAGEREXT_IMPL_SVNT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TARGETMANAGEREXT_IMPL_SVNT_HAS_DLL == 1 */
+
+// Set TARGETMANAGEREXT_IMPL_SVNT_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TARGETMANAGEREXT_IMPL_SVNT_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_SVNT_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TARGETMANAGEREXT_IMPL_SVNT_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TARGETMANAGEREXT_IMPL_SVNT_NTRACE */
+
+#if (TARGETMANAGEREXT_IMPL_SVNT_NTRACE == 1)
+# define TARGETMANAGEREXT_IMPL_SVNT_TRACE(X)
+#else /* (TARGETMANAGEREXT_IMPL_SVNT_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TARGETMANAGEREXT_IMPL_SVNT_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TARGETMANAGEREXT_IMPL_SVNT_NTRACE == 1) */
+
+#endif /* TARGETMANAGEREXT_IMPL_SVNT_EXPORT_H */
+
+// End of auto generated file.