23#include <condition_variable>
26#include <shared_mutex>
98 const std::string& commandLineParameters =
"",
99 bool printOnly =
false);
125 std::string commandLineParameters;
126 bool printOnly =
false;
132 void execute(
const Request&
request);
133 void executeStart(
const Request&
request);
134 void executeStop(
const Request&
request);
135 void executeRestart(
const Request&
request);
139 void launch(
const Request&
request);
140 void stopAndWait(
const Request&
request);
150 bool supersededByStop()
const;
153 void publishIntent();
158 mutable std::mutex mutex;
159 std::condition_variable idleCondition;
162 bool workerRunning =
false;
Owns every start and stop of one application - nothing else may launch or signal it.
ApplicationLifecycle(Data_Structure::ApplicationInstancePtr application, StatusManager statusManager)
void request(Data_Structure::Intent intent, const ApplicationStarterPtr &starter, const StopStrategyPtr &stopStrategy, const std::string &commandLineParameters="", bool printOnly=false)
Requests that the application be started, stopped or restarted, superseding any intent that has not b...
Data_Structure::Intent effectiveIntent() const
void wait()
Blocks until nothing is requested or running any more.
Intent
What the ScenarioManager is currently trying to do with an application.
std::shared_ptr< ApplicationInstance > ApplicationInstancePtr
std::shared_mutex & GlobalOperationMutex()
Held shared by every application operation, and exclusively by global operations that act on all arma...
std::shared_ptr< StopStrategy > StopStrategyPtr
std::mutex & LaunchMutex()
Serializes the actual spawning of applications.
std::shared_ptr< ApplicationStarter > ApplicationStarterPtr
std::shared_ptr< ApplicationLifecycle > ApplicationLifecyclePtr