class ModuleManager


 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

Process (class)

Process

 ModuleManager (EventLoop& eventloop, Rtrmgr& rtrmgr, bool do_restart, bool verbose, const string& xorp_root_dir)

ModuleManager

Constructor.

Parameters:

eventloopthe event loop to use.
rtrmgrthe router manager to use.
do_restartif true, then restart a module if it failed.
verboseif true, then output trace messages.
xorp_root_dirthe XORP root directory.
 ~ModuleManager ()

~ModuleManager

The default destructor.

bool  new_module (const string& module_name, const string& path, string& error_msg)

new_module

Create a new module.

Parameters:

module_namethe module name.
paththe path to the executable program for this module. It could be either the relative or expanded absolute path.
error_msgthe error message (if error).

Returns: true on success, otherwise false.

int  start_module (const string& module_name, bool do_exec, bool is_verification, XorpCallback1<void, bool>::RefPtr cb)

start_module

Start a module.

Parameters:

module_namethe module name.
do_execif true then indeed execute the executable program, otherwise just process the execution machinery.
is_verificationif true then this is verification of the execution machinery.
cbthe callback to dispatch at the end of the startup process.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  kill_module (const string& module_name, XorpCallback0<void>::RefPtr cb)

kill_module

Kill a module.

Parameters:

module_namethe module name.
cbthe callback to dispatch when the module is terminated.

Returns: XORP_OK on success, otherwise XORP_ERROR.

bool  module_is_running (const string& module_name)

module_is_running

[const]

Test whether a module is running.

Parameters:

module_namethe module name.

Returns: true if the module is running, otherwise false.

bool  module_has_started (const string& module_name)

module_has_started

[const]

Test whether a module has been started.

Parameters:

module_namethe module name.

Returns: true if the module has been started, otherwise false.

void  shutdown ()

shutdown

Shutdown the module manager.

bool  is_shutdown_completed ()

is_shutdown_completed

[const]

Test whether the shutdown has been completed.

Returns: true if the shutdown has been completed, otherwise false.

void  module_status_changed (const string& module_name, Module::ModuleStatus old_status, Module::ModuleStatus new_status)

module_status_changed

Change the status of a module.

Parameters:

module_namethe module name.
old_statusthe old status.
new_statusthe new status.
list<string>  get_module_names ()

get_module_names

[const]

Get the module names.

Returns: a list with the module names.

list<Module *>  find_running_modules_by_path (const string& expath)

find_running_modules_by_path

Get the running modules that match an executional path.

Parameters:

expaththe path to match.

Returns: a list of modules that are running and match expath.

int  execute_process (const string& expath, string& error_msg)

execute_process

Execute a process.

Parameters:

expaththe expanded path for the process to execute.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

void  process_exited (const string& expath, bool success, bool is_signal_terminated, int term_signal, bool is_coredumped)

process_exited

A method called when a process has exited.

Parameters:

expaththe expanded path for the process that has exited.
successif true, the exit status of the process indicates success, otherwise failure.
is_signal_terminatedif true the process has been terminated by a signal.
term_signalif is_signal_terminated is true, this contains the terminating signal.
is_coredumpedif true the process has generated a coredump.
void  process_stopped (const string& expath, int stop_signal)

process_stopped

A method called when a process has been stopped.

Parameters:

expaththe expanded path for the process that has been stopped.
stop_signalthe signal that has stopped the process.
ModuleManager::Process*  find_process_by_path (const string& expath)

find_process_by_path

Find a process by its expanded path.

Parameters:

expaththe expanded path for the process to find.

Returns: the corresponding process if found, otherwise NULL.

const string&  xorp_root_dir ()

xorp_root_dir

[const]

Get the XORP root directory.

Returns: the XORP root directory.

MasterConfigTree*  master_config_tree ()

master_config_tree

[const]

Get the master configuration tree.

Returns: the master configuration tree.

void  set_master_config_tree (MasterConfigTree* v)

set_master_config_tree

Set the master configuration tree.

Parameters:

vthe master configuration tree to set.
bool  do_restart ()

do_restart

[const]

Test if processes that have failed should be restarted.

Returns: true if failed processes should be restarted, otherwise false.


Generated by: bms on anglepoise.lon.incunabulum.net on Wed Jul 23 10:06:10 2008, using kdoc 2.0a54+XORP.