summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h')
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h65
1 files changed, 64 insertions, 1 deletions
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
index 96affb146d9..d133ed64fb2 100644
--- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
+++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.h
@@ -26,6 +26,8 @@
#include "ace/SString.h"
#include "ace/Hash_Map_Manager_T.h"
+#include "ace/OS_NS_sys_wait.h"
+#include "ace/Process_Manager.h"
#include "ciao/NodeApp_CB_Impl.h"
#include "ciao/DeploymentS.h"
#include "ciao/CIAO_common.h"
@@ -36,6 +38,7 @@
namespace CIAO
{
+
/**
* @class NodeApplicationManager_Impl_Base
*/
@@ -142,6 +145,13 @@ namespace CIAO
/// @note This method doesn't do duplicate.
Deployment::NodeApplicationManager_ptr get_nodeapp_manager (void);
+ /// Set the priority of the NodeApplication process which this NAM manages
+ virtual ::CORBA::Long set_priority (
+ const char * cid,
+ const ::Deployment::Sched_Params & params
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException ));
+
protected:
/// Destructor
virtual ~NodeApplicationManager_Impl_Base (void);
@@ -234,10 +244,52 @@ namespace CIAO
/// Synchronize access to the object set.
TAO_SYNCH_MUTEX lock_;
+
+ /// The Process Manager for this NodeApplicationManager
+ ACE_Process_Manager node_app_process_manager_;
+
+ /// The process id of the NA associated with the NAM,
+ /// Each NAM will only have one NA associated with it,
+ /// so we have only one process associated with it.
+
+ // this is UNIX specific .... not portable
+ pid_t process_id_;
};
/**
+ * @class NAM_Handler
+ * @brief The signal handler class for the SIGCHLD
+ * handling to avoid zombies
+ *
+ */
+ class NAM_Handler : public ACE_Event_Handler
+ {
+ public:
+ virtual int handle_signal (int sig,
+ siginfo_t *,
+ ucontext_t *)
+ {
+ ACE_UNUSED_ARG (sig);
+
+ // @@ Note that this code is not portable to all OS platforms
+ // since it uses print statements within signal handler context.
+ //ACE_DEBUG ((LM_DEBUG,
+ // "Executed ACE signal handler for signal %S \n",
+ // sig));
+
+ ACE_exitcode status;
+ // makes a claal to the underlying os system call
+ // -1 to wait for any child process
+ // and WNOHANG so that it retuurns immediately
+ ACE_OS::waitpid (-1 ,&status, WNOHANG, 0);
+
+ return 0;
+ }
+ };
+
+
+ /**
* @class NodeApplicationManager_Impl
*/
class CIAO_NAM_Export NodeApplicationManager_Impl
@@ -272,6 +324,18 @@ namespace CIAO
Deployment::ResourceNotAvailable,
Deployment::StartError,
Deployment::InvalidProperty));
+
+
+ /**
+ * @operation push_component_info
+ * @brief pushes component info to the NodeManager
+ *
+ * @param process_id The id of the process of NodeApplication
+ */
+ void push_component_info (pid_t process_id);
+
+ /// The signal handler
+ NAM_Handler child_handler_;
};
@@ -319,7 +383,6 @@ namespace CIAO
CIAO::NoOp_Configurator configurator_;
};
-
}
#if defined (__ACE_INLINE__)