|
|
Starts, stops and restarts applications and scenarios. More...
#include <ArmarXCore/util/ScenarioManagerCommon/executor/Executor.h>
Public Member Functions | |
| Executor (StopStrategyPtr strategy, ApplicationStarterPtr starter) | |
| Constructor that sets StopStrategy and ApplicationStarter. | |
| std::string | getApplicationStatus (Data_Structure::ApplicationInstancePtr application) |
| Returns the status of an application. | |
| StopStrategyPtr | getDefaultStopStrategy () |
| ApplicationStarterPtr | getStarter (Data_Structure::ScenarioPtr scenario) |
| StopStrategyPtr | getStopStrategy (Data_Structure::ScenarioPtr scenario) |
| void | restartApplication (Data_Structure::ApplicationInstancePtr application, bool printOnly=false) |
| Requests that an application be restarted. | |
| void | restartScenario (Data_Structure::ScenarioPtr scenario, bool printOnly=false) |
| Restarts a scenario. | |
| void | setDefaultStarter (ApplicationStarterPtr appStarter) |
| Sets the appStarter this Executor uses to start applications and request statuses. | |
| void | setDefaultStopStrategy (StopStrategyPtr strategy) |
| Sets the strategy this Executor uses to stop applications. | |
| void | setStarter (ApplicationStarterPtr appStarter, Data_Structure::ScenarioPtr scenario) |
| void | setStopStrategy (StopStrategyPtr strategy, Data_Structure::ScenarioPtr scenario) |
| void | startApplication (Data_Structure::ApplicationInstancePtr application, bool printOnly=false, const std::string &commandLineParameters="") |
| Requests that an application be started. | |
| void | startScenario (Data_Structure::ScenarioPtr scenario, bool printOnly=false, const std::string &commandLineParameters="") |
| Starts a scenario. | |
| void | stopApplication (Data_Structure::ApplicationInstancePtr application) |
| Requests that an application be stopped. | |
| void | stopScenario (Data_Structure::ScenarioPtr scenario) |
| Stops a scenario. | |
| void | waitForApplication (const Data_Structure::ApplicationInstancePtr &application) |
| Blocks until the application has no operation requested or running any more. | |
| void | waitForScenario (const Data_Structure::ScenarioPtr &scenario) |
| Blocks until no application of the scenario has an operation requested or running. | |
Static Public Member Functions | |
| static void | loadAndSetCachedProperties (Data_Structure::ApplicationPtr application, std::string path, bool reload=false, bool set=true) |
| Generates an XML file of the given application and saves it in the specified path. | |
Starts, stops and restarts applications and scenarios.
Can also be used to request the status of an application. The proper system-specific stopstrategy and starter have to be set in the constructor.
Definition at line 61 of file Executor.h.
| Executor | ( | Exec::StopStrategyPtr | strategy, |
| Exec::ApplicationStarterPtr | starter ) |
Constructor that sets StopStrategy and ApplicationStarter.
| strategy | Strategy used to stop applications. |
| starter | Starter used to start applications and request their status. |
Definition at line 47 of file Executor.cpp.
Here is the call graph for this function:| std::string getApplicationStatus | ( | Data_Structure::ApplicationInstancePtr | application | ) |
Returns the status of an application.
Uses the ApplicationStarter to request the status, therefore the proper system-specific starter has to be set, even to use this method.
| application | application whose status is returned |
Definition at line 116 of file Executor.cpp.
Here is the call graph for this function:| Exec::StopStrategyPtr getDefaultStopStrategy | ( | ) |
Definition at line 316 of file Executor.cpp.
| Exec::ApplicationStarterPtr getStarter | ( | Data_Structure::ScenarioPtr | scenario | ) |
| Exec::StopStrategyPtr getStopStrategy | ( | Data_Structure::ScenarioPtr | scenario | ) |
|
static |
Generates an XML file of the given application and saves it in the specified path.
If there already is an XML file at that location it only reloads the file if the executable is more recently changed than the Xml file
| application | Application whose XML file is to be generate |
| path | location to save the XML, must be a folder |
| reload | forces to reload the cached XML |
| set | if true the newly Cached Xml gets loaded into the Application (Warning: If you load an ApplicationInstance the cfg parameter have to be reloaded) |
Definition at line 218 of file Executor.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void restartApplication | ( | Data_Structure::ApplicationInstancePtr | application, |
| bool | printOnly = false ) |
Requests that an application be restarted.
An application that is not running is started.
| application | application to be restarted |
Definition at line 89 of file Executor.cpp.
Here is the call graph for this function:| void restartScenario | ( | Data_Structure::ScenarioPtr | scenario, |
| bool | printOnly = false ) |
Restarts a scenario.
Iterates over the applications in the scenario and restarts them.
| scenario | scenario to be restarted |
true if all applications were successfully restarted Definition at line 163 of file Executor.cpp.
| void setDefaultStarter | ( | ApplicationStarterPtr | appStarter | ) |
Sets the appStarter this Executor uses to start applications and request statuses.
Needs to be system specific. Use the Factory-Classes to get the proper appStarter for your system.
| appStarter | appStarter to be set |
Definition at line 278 of file Executor.cpp.
Here is the caller graph for this function:| void setDefaultStopStrategy | ( | StopStrategyPtr | strategy | ) |
Sets the strategy this Executor uses to stop applications.
Needs to be system specific. Use the Factory-Classes to get the proper strategy for your system.
| strategy | strategy to be set |
Definition at line 272 of file Executor.cpp.
Here is the caller graph for this function:| void setStarter | ( | ApplicationStarterPtr | appStarter, |
| Data_Structure::ScenarioPtr | scenario ) |
Definition at line 290 of file Executor.cpp.
| void setStopStrategy | ( | StopStrategyPtr | strategy, |
| Data_Structure::ScenarioPtr | scenario ) |
Definition at line 284 of file Executor.cpp.
| void startApplication | ( | Data_Structure::ApplicationInstancePtr | application, |
| bool | printOnly = false, | ||
| const std::string & | commandLineParameters = "" ) |
Requests that an application be started.
All of these methods record an intent and return immediately; the work happens on a worker thread owned by the application's ApplicationLifecycle. A request supersedes any intent that has not been carried out yet, so the last thing the user asked for is what happens. Nothing is ever refused.
| application | application to be started. |
Definition at line 67 of file Executor.cpp.
Here is the call graph for this function:| void startScenario | ( | Data_Structure::ScenarioPtr | scenario, |
| bool | printOnly = false, | ||
| const std::string & | commandLineParameters = "" ) |
Starts a scenario.
Iterates over the applications in the scenario and starts them.
| scenario | scenario to be started |
true if all applications were successfully started Definition at line 149 of file Executor.cpp.
| void stopApplication | ( | Data_Structure::ApplicationInstancePtr | application | ) |
Requests that an application be stopped.
| application | application to be stopped |
Definition at line 81 of file Executor.cpp.
Here is the call graph for this function:| void stopScenario | ( | Data_Structure::ScenarioPtr | scenario | ) |
Stops a scenario.
Iterates over the applications in the scenario and stops them.
| scenario | scenario to be stopped |
true if all applications were successfully stopped Definition at line 157 of file Executor.cpp.
| void waitForApplication | ( | const Data_Structure::ApplicationInstancePtr & | application | ) |
Blocks until the application has no operation requested or running any more.
The GUI never needs this - it watches the status instead - but a caller that exits right afterwards, such as the command line interface, has to see the operation through.
Definition at line 101 of file Executor.cpp.
Here is the caller graph for this function:| void waitForScenario | ( | const Data_Structure::ScenarioPtr & | scenario | ) |
Blocks until no application of the scenario has an operation requested or running.
Definition at line 107 of file Executor.cpp.
Here is the call graph for this function: