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.

Constructor & Destructor Documentation

◆ StopStrategy()

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.

◆ 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

◆ TerminationTimeout

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

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


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