StopStrategy Class Referenceabstract

Interface for classes that define how an application get stopped. More...

#include <ArmarXCore/util/ScenarioManagerCommon/executor/StopStrategy.h>

+ Inheritance diagram for StopStrategy:

Public Member Functions

virtual void stop (Data_Structure::ApplicationInstancePtr application)=0
 Stops an application.
 
 StopStrategy (ApplicationStopperPtr stopper)
 

Protected Member Functions

void awaitTermination (const Data_Structure::ApplicationInstancePtr &application, int signalledPid)
 Waits until the process that was signalled has terminated, then clears the application's pid.
 

Protected Attributes

ApplicationStopperPtr stopper
 

Static Protected Attributes

static constexpr std::chrono::milliseconds TerminationTimeout {10000}
 How long to wait for a signalled process to actually disappear before giving up.
 

Detailed Description

Interface for classes that define how an application get stopped.

Definition at line 27 of file StopStrategy.h.

Constructor & Destructor Documentation

◆ StopStrategy()

Definition at line 36 of file StopStrategy.cpp.

+ Here is the caller graph for this function:

Member Function Documentation

◆ awaitTermination()

void awaitTermination ( const Data_Structure::ApplicationInstancePtr & application,
int signalledPid )
protected

Waits until the process that was signalled has terminated, then clears the application's pid.

A stop is only finished once the process is really gone. Returning earlier would let a directly following start race with a process that is still shutting down, and would make the status poller and the stopper fight over the pid and the cached pid file.

Parameters
applicationthe application that was signalled.
signalledPidthe pid that was signalled, or -1 if nothing was signalled.

Definition at line 41 of file StopStrategy.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

virtual void stop ( Data_Structure::ApplicationInstancePtr application)
pure virtual

Stops an application.

Implement this method to define the behaviour when stopping applications.

Parameters
applicationapplication to be stopped.

Implemented in Kill, Stop, and StopAndKill.

Member Data Documentation

◆ stopper

ApplicationStopperPtr stopper
protected

Definition at line 30 of file StopStrategy.h.

◆ TerminationTimeout

std::chrono::milliseconds TerminationTimeout {10000}
staticconstexprprotected

How long to wait for a signalled process to actually disappear before giving up.

Definition at line 35 of file StopStrategy.h.


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