Keeps track of which XORP processes of interest are alive.
More...
#include <process_watch.hh>
List of all members.
Classes |
| class | Process |
| class | PWException |
| | Exception thrown on error, such as Xrl failure. More...
|
Public Types |
typedef XorpCallback0< void >
::RefPtr | TerminateCallback |
Public Member Functions |
|
| ProcessWatch (XrlStdRouter *xrl_router, EventLoop &eventloop, const char *bgp_mib_name, TerminateCallback cb) |
|
void | birth (const string &target_class, const string &target_instance) |
| | Method to call when the birth of a process has been detected.
|
|
void | death (const string &target_class, const string &target_instance) |
| | Method to call when the death of a process has been detected.
|
|
void | finder_death (const char *file, const int lineno) |
| | Method to call if the finder dies.
|
|
void | start_kill_timer () |
| | Start a timer to kill this process if for some reason we get hung up.
|
| bool | ready () const |
| bool | target_exists (const string &target) const |
| | ProcessWatch (XrlStdRouter &rtr, ProtocolMap &pmap) |
| void | register_cb (const XrlError &err) |
| | Callback for all Xrl calls.
|
| void | add_interest (const string &proc) |
| | Add an interest in a protocol.
|
| void | birth (const string &proto) |
| | Announce birth of a protocol [process].
|
| void | death (const string &proto) |
| | Announce death of a protocol.
|
| bool | alive (const string &proto) |
| | An exception is thrown if the process watch is not watching the requested protocol.
|
| void | set_notifier (PWNotifier ¬ifier) |
| | Set an object which will receive birth/death notifications.
|
Protected Member Functions |
|
void | interest_callback (const XrlError &error) |
|
void | add_target (const string &target_class, const string &target_instance) |
|
void | remove_target (const string &target_class, const string &target_instance) |
Private Attributes |
|
EventLoop & | _eventloop |
|
TerminateCallback | _shutdown |
|
bool | _fea |
|
bool | _rib |
|
string | _fea_instance |
|
string | _rib_instance |
|
XorpTimer | _shutdown_timer |
|
list< Process > | _processes |
|
ProtocolMap & | _pmap |
|
set< string > | _watching |
|
set< string > | _alive |
|
XrlFinderEventNotifierV0p1Client | _finder |
|
string | _instance_name |
|
PWNotifier * | _notifier |
|
string | _finder_name |
Detailed Description
Keeps track of which XORP processes of interest are alive.
The VarMap will register interest in protocols for known protocols with the ProcessWatch. The ProcessWatch will then register this interest with the finder.
Very similar / identical to BGP's process watch.
Constructor & Destructor Documentation
- Parameters:
-
| rtr | Xrl router to use. |
| pmap | protocol map. |
Member Function Documentation
| void ProcessWatch::add_interest |
( |
const string & |
proc | ) |
[virtual] |
Add an interest in a protocol.
- Parameters:
-
| proc | process of the protocol to add interest for. |
Implements ProcessWatchBase.
| bool ProcessWatch::alive |
( |
const string & |
proto | ) |
|
An exception is thrown if the process watch is not watching the requested protocol.
- Returns:
- true if protocol is alive, false otherwise.
- Parameters:
-
| proto | protocol for which status is requested. |
| void ProcessWatch::birth |
( |
const string & |
proto | ) |
|
Announce birth of a protocol [process].
- Parameters:
-
| proto | protocol that came to life. |
| void ProcessWatch::death |
( |
const string & |
proto | ) |
|
Announce death of a protocol.
- Parameters:
-
| bool ProcessWatch::ready |
( |
| ) |
const |
- Returns:
- Return true when all the processes that BGP requires for correct operation are running.
| void ProcessWatch::register_cb |
( |
const XrlError & |
err | ) |
|
Callback for all Xrl calls.
- Parameters:
-
| void ProcessWatch::set_notifier |
( |
PWNotifier & |
notifier | ) |
|
Set an object which will receive birth/death notifications.
If a previous object was "registered", it will be removed. Only one object may receive notifications.
- Parameters:
-
| notifier | object where notifications should be sent. |
| bool ProcessWatch::target_exists |
( |
const string & |
target | ) |
const |
- Returns:
- true if the target process exists.
The documentation for this class was generated from the following files:
- /home/greearb/git/xorp.ct.github/xorp/bgp/process_watch.hh
- /home/greearb/git/xorp.ct.github/xorp/policy/process_watch.hh
- /home/greearb/git/xorp.ct.github/xorp/bgp/process_watch.cc
- /home/greearb/git/xorp.ct.github/xorp/policy/process_watch.cc