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.
 
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.
 
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.
 
basis::outcome remove_from_startup (const basis::astring &product, const basis::astring &app_name)
 takes the "app_name" out of the startup list.
 
basis::outcome query_application (const basis::astring &product, const basis::astring &app_name)
 retrieves the current state of the program with "app_name".
 
basis::outcome zap_process (const basis::astring &product, const basis::astring &app_name, bool graceful)
 zaps the process named "app_name".
 
void add_gag_exclusion (const basis::astring &exclusion)
 add an application that isn't subject to gagging.
 
void add_tracking_exclusion (const basis::astring &exclusion)
 apps that aren't tracked when running.
 
basis::outcome shut_down_launching_services (const basis::astring &secret_word)
 closes down the ability of clients to launch applications.
 
basis::outcome reenable_launching_services (const basis::astring &secret_word)
 undoes the gagging that the above "shut_down" function does.
 
bool services_disabled () const
 returns true if the capability to launch new processes is revoked.
 
void push_timed_activities (processes::process_entry_array &processes)
 keeps any periodic activities going.
 
void stop_everything ()
 closes down the operation of this object.
 

Static Public Member Functions

static const char * outcome_name (const basis::outcome &to_name)
 returns the text associated with "to_name".
 

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 
)

◆ 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::common::outcome_name(), and 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 processes::process_control::find_process_in_list(), 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: