|
virtual | ~ISuperviseApplication ()=default |
| Default destructor.
|
void | Name (std::string name) |
| Name of the application.
|
const std::string & | Name () const |
| Name of the application.
|
void | Path (std::string path) |
| Path to the executable.
|
const std::string & | Path () const |
| Path to the executable.
|
void | Arguments (std::string arguments) |
| Command line arguments to use at startup.
|
const std::string & | Arguments () const |
| Command line arguments.
|
void | Startup (ApplicationStartup startup) |
| Startup mode for the application.
|
ApplicationStartup | Startup () const |
| Startup mode for the application.
|
void | Priority (ApplicationPriority priority) |
| Defines the priority for the executable.
|
ApplicationPriority | Priority () const |
| Returns the executable priority.
|
void | ShowWindow (bool show) |
| Sets to true if a window should be shown.
|
bool | ShowWindow () const |
| True if window should be shown.
|
void | StartupDelay (uint32_t delay) |
| Initial startup delay in seconds.
|
uint32_t | StartupDelay () const |
| Returns the startup delay in seconds.
|
void | MaxRestarts (uint32_t max_restarts) |
| Sets maximum number of restarts.
|
uint32_t | MaxRestarts () const |
| Maximum number of restarts.
|
void | InService (bool in_service) |
| Starts or stops the executable.
|
bool | InService () const |
| Returns true if the executable should be started.
|
uint32_t | NofRestarts () const |
| Returns number of restarts.
|
bool | Operable () const |
| Returns true if the executable is running.
|
ApplicationState | State () const |
| Returns the state of the supervisor.
|
virtual void | Start () |
| Initialize and start the supervisor.
|
virtual void | Stop () |
| Stops the supervisor.
|
virtual void | Poll () |
| Poll the supervisor.
|
void | ReadConfig (const xml::IXmlNode &application_node) |
| Reads in the configuration.
|
void | SaveConfig (xml::IXmlNode &root_node) const |
| Saves the application configuration.
|
The class supervise an external executable application. It start, supervise and stop the application. The application startup mode controls how the application is supervised.
In the Manual mode, the application is started when it is taken in-service by a remote application. If it is taken out-of-service, it stops. If it exit before it is taken out-of-service, the state is set to ApplicationState::Ready.
In the Once mode, the application only run once at startup. It is very similar to the Manual mode but it is set to in-service at startup.
In the Automatic mode, the application is started at startup and then checked that it is running. If the application stops, it will be restarted. Note that the restart is delayed 2-10 seconds. If number of restarts reach a maximum limit, it will stop restarting and a critical log event will be generated.
The startup mode is set to each application and defines how it start, stop and being supervised.
In the Manual mode, the application is started when it is taken in-service by a remote application. If it is taken out-of-service, it stops. If it exit before it is taken out-of-service, the state is set to ApplicationState::Ready.
In the Once mode, the application only run once at startup. It is very similar to the Manual mode but it is set to in-service at startup.
In the Automatic mode, the application is started at startup and then checked that it is running. If the application stops, it will be restarted. Note that the restart is delayed 2-10 seconds. If number of restarts reach a maximum limit, it will stop restarting and a critical log event will be generated.
- Parameters
-