A class for managing router manager modules.
More...
#include <module_manager.hh>
List of all members.
Public Member Functions |
| | Module (ModuleManager &mmgr, const string &name, const string &path, const string &expath, bool verbose) |
| | Constructor.
|
|
virtual | ~Module () |
| | The default destructor.
|
| void | new_status (ModuleStatus new_status) |
| | Set new status for the module.
|
| string | str () const |
| | Convert the module information to a string.
|
| ModuleManager & | module_manager () const |
| | Get a reference to the module manager (ModuleManager).
|
| const string & | expath () const |
| | Get the expanded absolute path to the executable program.
|
| int | execute (bool do_exec, bool is_verification, XorpCallback1< void, bool >::RefPtr cb) |
| | Execute the module.
|
| int | restart () |
| | Restart the module.
|
| void | terminate (XorpCallback0< void >::RefPtr cb) |
| | Terminate the module.
|
| void | terminate_with_prejudice (XorpCallback0< void >::RefPtr cb) |
| | Terminate the module with prejudice.
|
| void | module_exited (bool success, bool is_signal_terminated, int term_signal, bool is_coredumped) |
| | A method called when the corresponding process has exited.
|
| void | module_stopped (int stop_signal) |
| | A method called when the corresponding process has been stopped.
|
Private Member Functions |
|
void | module_restart_cb (bool success) |
Private Attributes |
|
ModuleManager & | _mmgr |
|
string | _path |
|
string | _expath |
|
bool | _do_exec |
|
bool | _verbose |
|
XorpTimer | _shutdown_timer |
|
XorpCallback0< void >::RefPtr | _terminate_cb |
Static Private Attributes |
|
static const TimeVal | SHUTDOWN_TIMEOUT_TIMEVAL = TimeVal(2, 0) |
Detailed Description
A class for managing router manager modules.
Constructor & Destructor Documentation
| Module::Module |
( |
ModuleManager & |
mmgr, |
|
|
const string & |
name, |
|
|
const string & |
path, |
|
|
const string & |
expath, |
|
|
bool |
verbose |
|
) |
| |
Constructor.
- Parameters:
-
| mmgr | the module manager (ModuleManager) to use. |
| name | the module name. |
| path | the path to the executable program for this module. |
| expath | the expanded absolute path to the executable program for this module. |
| verbose | if true, then output trace messages. |
Member Function Documentation
| int Module::execute |
( |
bool |
do_exec, |
|
|
bool |
is_verification, |
|
|
XorpCallback1< void, bool >::RefPtr |
cb |
|
) |
| |
Execute the module.
- Parameters:
-
| do_exec | if true then indeed execute the executable program, otherwise just process the execution machinery. |
- Returns:
- XORP_OK on success, otherwise XORP_ERROR.
| const string& Module::expath |
( |
| ) |
const [inline] |
Get the expanded absolute path to the executable program.
- Returns:
- the expanded absolute path to the executable program.
| void Module::module_exited |
( |
bool |
success, |
|
|
bool |
is_signal_terminated, |
|
|
int |
term_signal, |
|
|
bool |
is_coredumped |
|
) |
| |
A method called when the corresponding process has exited.
- Parameters:
-
| success | if true, the exit status of the process indicates success, otherwise failure. |
| is_signal_terminated | if true the process has been terminated by a signal. |
| term_signal | if is_signal_terminated is true, this contains the terminating signal. |
| is_coredumped | if true the process has generated a coredump. |
Get a reference to the module manager (ModuleManager).
- Returns:
- a reference to the module manager.
| void Module::module_stopped |
( |
int |
stop_signal | ) |
|
A method called when the corresponding process has been stopped.
- Parameters:
-
| stop_signal | the signal that has stopped the process. |
| void Module::new_status |
( |
ModuleStatus |
new_status | ) |
[virtual] |
Set new status for the module.
- Parameters:
-
| new_status | the new status for the module. |
Reimplemented from GenericModule.
Restart the module.
- Returns:
- XORP_OK on success, otherwise XORP_ERROR.
| string Module::str |
( |
| ) |
const [virtual] |
Convert the module information to a string.
- Returns:
- a string with the module information.
Reimplemented from GenericModule.
| void Module::terminate |
( |
XorpCallback0< void >::RefPtr |
cb | ) |
|
Terminate the module.
- Parameters:
-
| cb | the callback to execute after the module is terminated. |
| void Module::terminate_with_prejudice |
( |
XorpCallback0< void >::RefPtr |
cb | ) |
|
Terminate the module with prejudice.
- Parameters:
-
| cb | the callback to execute after the module is terminated. |
The documentation for this class was generated from the following files:
- /home/greearb/git/xorp.ct.github/xorp/rtrmgr/module_manager.hh
- /home/greearb/git/xorp.ct.github/xorp/rtrmgr/module_manager.cc