feisty meow concerns codebase  2.140
application::launch_manager Class Reference

Provides methods for starting, stopping and checking on processes. More...

#include <launch_manager.h>

Inheritance diagram for application::launch_manager:
Collaboration diagram for application::launch_manager:

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 &parameters)
 starts the application "app_name" now. More...
 
basis::outcome 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. 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ outcomes

Enumerator
OKAY 
EXISTING 

the entry already exists and overwriting is disallowed.

ACCESS_DENIED 

the requested operation was not permitted.

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 
LAST_OUTCOME 

Definition at line 59 of file launch_manager.h.

Constructor & Destructor Documentation

◆ launch_manager()

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.

◆ ~launch_manager()

application::launch_manager::~launch_manager ( )
virtual

Definition at line 148 of file launch_manager.cpp.

References FUNCDEF, LOG, stop_everything(), and basis::WHACK().

Member Function Documentation

◆ add_gag_exclusion()

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.

◆ add_tracking_exclusion()

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.

◆ DEFINE_CLASS_NAME()

application::launch_manager::DEFINE_CLASS_NAME ( "launch_manager"  )

◆ launch_at_startup()

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().

◆ launch_now()

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().

◆ outcome_name()

const char * application::launch_manager::outcome_name ( const basis::outcome to_name)
static

returns the text associated with "to_name".

Definition at line 172 of file launch_manager.cpp.

References basis::outcome::value().

◆ push_timed_activities()

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().

◆ query_application()

outcome application::launch_manager::query_application ( const basis::astring product,
const basis::astring app_name 
)

◆ reenable_launching_services()

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.

◆ remove_from_startup()

outcome application::launch_manager::remove_from_startup ( const basis::astring product,
const basis::astring app_name 
)

◆ services_disabled()

bool application::launch_manager::services_disabled ( ) const
inline

returns true if the capability to launch new processes is revoked.

Definition at line 136 of file launch_manager.h.

◆ shut_down_launching_services()

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.

◆ stop_everything()

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().

◆ zap_process()

outcome application::launch_manager::zap_process ( const basis::astring product,
const basis::astring app_name,
bool  graceful 
)

The documentation for this class was generated from the following files: