Salome HOME
[EDF29852] : test of mecanism of replay on error
[modules/kernel.git] / src / Container / SALOME_ContainerManager.hxx
index 9c75c71d2735cd353a63a5310a2b6a92548d3055..1ca71fef20e05304953db68a02e76451fc3a5b9b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "Utils_Mutex.hxx"
 
+#include <vector>
 #include <string>
+#include <utility>
+#include <functional>
 #include <set>
 
 class SALOME_NamingService_Abstract;
@@ -46,17 +49,41 @@ public:
   ~SALOME_ContainerManager();
 
   // Corba Methods
-  Engines::Container_ptr GiveContainer(const Engines::ContainerParameters& params);
+  Engines::Container_ptr GiveContainer(const Engines::ContainerParameters& params) override;
 
-  void ShutdownContainers();
+  void ShutdownContainers() override;
+
+  void ShutdownContainersNow() override;
+
+  void SetOverrideEnvForContainers(const Engines::KeyValDict& env) override;
+
+  Engines::KeyValDict *GetOverrideEnvForContainers() override;
+
+  void SetCodeOnContainerStartUp(const char *code) override;
 
   // C++ Methods
   void Shutdown();
 
   void DeclareUsingSalomeSession() { _isSSL = false; }
 
+  CORBA::Long GetTimeOutToLaunchServerInSecond() override;
+
+  void SetTimeOutToLaunchServerInSecond(CORBA::Long timeInSecond) override;
+
+  CORBA::Long GetDeltaTimeBetweenNSLookupAtLaunchTimeInMilliSecond() override;
+
+  void SetDeltaTimeBetweenNSLookupAtLaunchTimeInMilliSecond(CORBA::Long timeInMS) override;
+
+  CORBA::Long GetDeltaTimeBetweenCPUMemMeasureInMilliSecond() override;
+
+  void SetDeltaTimeBetweenCPUMemMeasureInMilliSecond(CORBA::Long timeInMS) override;
+
   static const char *_ContainerManagerNameInNS;
 
+private:
+
+  void ShutdownContainersGeneric(std::function<void(Engines::Container_ptr)> funcToBeCalledOnContainer);
+
 protected:
   // C++ methods
   Engines::Container_ptr
@@ -67,6 +94,8 @@ protected:
   FindContainer(const Engines::ContainerParameters& params,
                 const std::string& resource);
 
+  std::string GetCppBinaryOfKernelSSLContainer() const;
+
   std::string GetCppBinaryOfKernelContainer() const;
   
   std::string GetRunRemoteExecutableScript() const;
@@ -191,7 +220,14 @@ public:
   static void SleepInSecond(int ellapseTimeInSecond);
  private:
   static const int TIME_OUT_TO_LAUNCH_CONT;
+  static const int DFT_DELTA_TIME_NS_LOOKUP_IN_MS;
   static Utils_Mutex _getenvMutex;
   static Utils_Mutex _systemMutex;
+private:
+  std::vector< std::pair<std::string, std::string> > _override_env;
+  int _time_out_in_second;
+  int _delta_time_ns_lookup_in_ms;
+  int _delta_time_measure_in_ms;
+  std::string _code_to_exe_on_startup;
 };
 #endif