feisty meow concerns codebase
2.140
|
Provides methods for starting, stopping and checking on processes. More...
#include <launch_manager.h>
Public Types | |
enum | outcomes { OKAY = basis::common::OKAY , EXISTING = basis::common::EXISTING , ACCESS_DENIED = basis::common::ACCESS_DENIED , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , DEFINE_API_OUTCOME , FIRST_OUTCOME = FROZEN , LAST_OUTCOME = FILE_NOT_FOUND } |
Public Member Functions | |
launch_manager (processes::configured_applications &config) | |
the launch_manager needs a configuration set to work with. More... | |
virtual | ~launch_manager () |
DEFINE_CLASS_NAME ("launch_manager") | |
basis::outcome | launch_now (const basis::astring &product, const basis::astring &app_name, const basis::astring ¶meters) |
starts the application "app_name" now. More... | |
basis::outcome | launch_at_startup (const basis::astring &product, const basis::astring &app_name, const basis::astring ¶meters, int one_shot) |
records an entry for the "app_name" to be launched at startup. More... | |
basis::outcome | remove_from_startup (const basis::astring &product, const basis::astring &app_name) |
takes the "app_name" out of the startup list. More... | |
basis::outcome | query_application (const basis::astring &product, const basis::astring &app_name) |
retrieves the current state of the program with "app_name". More... | |
basis::outcome | zap_process (const basis::astring &product, const basis::astring &app_name, bool graceful) |
zaps the process named "app_name". More... | |
void | add_gag_exclusion (const basis::astring &exclusion) |
add an application that isn't subject to gagging. More... | |
void | add_tracking_exclusion (const basis::astring &exclusion) |
apps that aren't tracked when running. More... | |
basis::outcome | shut_down_launching_services (const basis::astring &secret_word) |
closes down the ability of clients to launch applications. More... | |
basis::outcome | reenable_launching_services (const basis::astring &secret_word) |
undoes the gagging that the above "shut_down" function does. More... | |
bool | services_disabled () const |
returns true if the capability to launch new processes is revoked. More... | |
void | push_timed_activities (processes::process_entry_array &processes) |
keeps any periodic activities going. More... | |
void | stop_everything () |
closes down the operation of this object. More... | |
Static Public Member Functions | |
static const char * | outcome_name (const basis::outcome &to_name) |
returns the text associated with "to_name". More... | |
Provides methods for starting, stopping and checking on processes.
This includes support for graceful shutdowns and background handling of exiting processes.
Definition at line 49 of file launch_manager.h.
Definition at line 59 of file launch_manager.h.
application::launch_manager::launch_manager | ( | processes::configured_applications & | config | ) |
the launch_manager needs a configuration set to work with.
Definition at line 125 of file launch_manager.cpp.
References FUNCDEF, and NULL_POINTER.
|
virtual |
Definition at line 148 of file launch_manager.cpp.
References FUNCDEF, LOG, stop_everything(), and basis::WHACK().
void application::launch_manager::add_gag_exclusion | ( | const basis::astring & | exclusion | ) |
add an application that isn't subject to gagging.
if the launch_manager is gagged, the excluded applications can still be started.
Definition at line 166 of file launch_manager.cpp.
void application::launch_manager::add_tracking_exclusion | ( | const basis::astring & | exclusion | ) |
apps that aren't tracked when running.
if a zap is attempted on one of these applications, then the process is not shut down.
Definition at line 169 of file launch_manager.cpp.
application::launch_manager::DEFINE_CLASS_NAME | ( | "launch_manager" | ) |
outcome application::launch_manager::launch_at_startup | ( | const basis::astring & | product, |
const basis::astring & | app_name, | ||
const basis::astring & | parameters, | ||
int | one_shot | ||
) |
records an entry for the "app_name" to be launched at startup.
this does not launch the application now. if "one_shot" is true, the application will only be started once and then removed from the list.
Definition at line 430 of file launch_manager.cpp.
References processes::configured_applications::add_startup_entry(), COMPLAIN_APPLICATION, COMPLAIN_PRODUCT, EXISTING, processes::configured_applications::find_program(), FUNCDEF, LOCK_CONFIG, LOG, OKAY, and processes::configured_applications::product_exists().
outcome application::launch_manager::launch_now | ( | const basis::astring & | product, |
const basis::astring & | app_name, | ||
const basis::astring & | parameters | ||
) |
starts the application "app_name" now.
causes the program with "app_name" that's listed for the "product" to be started with the "parameters". this can fail if the application isn't listed or if the program can't be found or if the process can't be created.
Definition at line 305 of file launch_manager.cpp.
References COMPLAIN_APPLICATION, COMPLAIN_PRODUCT, structures::set< contents >::elements(), filesystem::filename::exists(), processes::configured_applications::find_program(), FUNCDEF, basis::astring::length(), LOCK_CONFIG, LOCK_KIDS, LOG, application::MAXIMUM_INITIAL_APP_WAIT, structures::set< contents >::member(), OKAY, processes::configured_applications::product_exists(), and basis::astring::s().
|
static |
returns the text associated with "to_name".
Definition at line 172 of file launch_manager.cpp.
References basis::outcome::value().
void application::launch_manager::push_timed_activities | ( | processes::process_entry_array & | processes | ) |
keeps any periodic activities going.
this includes such tasks as zapping processes that have gone beyond their time limit for graceful shutdown.
Definition at line 700 of file launch_manager.cpp.
References FUNCDEF, GET_PROCESSES, application::GRACEFUL_SLACK, LOCK_KIDS, LOCK_ZOMBIES, LOG, structures::set< contents >::member(), and processes::process_control::zap_process().
outcome application::launch_manager::query_application | ( | const basis::astring & | product, |
const basis::astring & | app_name | ||
) |
retrieves the current state of the program with "app_name".
Definition at line 494 of file launch_manager.cpp.
References COMPLAIN_APPLICATION, COMPLAIN_PRODUCT, processes::configured_applications::find_program(), FUNCDEF, LOCK_CONFIG, LOG, OKAY, processes::configured_applications::product_exists(), and basis::astring::to_lower().
outcome application::launch_manager::reenable_launching_services | ( | const basis::astring & | secret_word | ) |
undoes the gagging that the above "shut_down" function does.
this allows the launch_manager to continue operating normally.
Definition at line 677 of file launch_manager.cpp.
References basis::astring::equal_to(), FUNCDEF, LOG, and OKAY.
outcome application::launch_manager::remove_from_startup | ( | const basis::astring & | product, |
const basis::astring & | app_name | ||
) |
takes the "app_name" out of the startup list.
Definition at line 462 of file launch_manager.cpp.
References COMPLAIN_APPLICATION, COMPLAIN_PRODUCT, processes::configured_applications::find_program(), FUNCDEF, LOCK_CONFIG, LOG, OKAY, processes::configured_applications::product_exists(), and processes::configured_applications::remove_startup_entry().
|
inline |
returns true if the capability to launch new processes is revoked.
Definition at line 136 of file launch_manager.h.
outcome application::launch_manager::shut_down_launching_services | ( | const basis::astring & | secret_word | ) |
closes down the ability of clients to launch applications.
the checking and shut down functions continue to operate. this is intended for use prior to a restart of the application controller, in order to ensure that no remote clients can start new servers on this machine.
Definition at line 662 of file launch_manager.cpp.
References basis::astring::equal_to(), FUNCDEF, LOG, and OKAY.
void application::launch_manager::stop_everything | ( | ) |
closes down the operation of this object.
Definition at line 187 of file launch_manager.cpp.
Referenced by ~launch_manager().
outcome application::launch_manager::zap_process | ( | const basis::astring & | product, |
const basis::astring & | app_name, | ||
bool | graceful | ||
) |
zaps the process named "app_name".
if "graceful" is true, then the clean shutdown process is attempted. otherwise the application is harshly terminated.
Definition at line 588 of file launch_manager.cpp.
References ACCESS_DENIED, filesystem::filename::basename(), COMPLAIN_APPLICATION, COMPLAIN_PRODUCT, structures::set< contents >::elements(), processes::configured_applications::find_program(), FUNCDEF, LOCK_CONFIG, LOG, structures::set< contents >::member(), OKAY, processes::configured_applications::product_exists(), and processes::process_control::zap_process().