summaryrefslogtreecommitdiff
path: root/DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp')
-rw-r--r--DAnCE/TargetManager_Ext/TargetManagerExt_Impl_exec_i.cpp325
1 files changed, 325 insertions, 0 deletions
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;
+ }
+}
+