namespace SALOME
{
- enum class PyExecutionMode { NotSet, InProcess, OutOfProcessNoReplay, OutOfProcessWithReplay };
-
static constexpr char IN_PROCESS_VALUE = 0;
static constexpr char IN_PROCESS_VALUE_STR[] = "InProcess";
static constexpr char OUT_OF_PROCESS_NO_REPLAY_VALUE = 1;
namespace SALOME
{
- enum class PyExecutionMode;
+ enum class PyExecutionMode { NotSet, InProcess, OutOfProcessNoReplay, OutOfProcessWithReplay };
void BASICS_EXPORT SetPyExecutionMode(PyExecutionMode mode);
void BASICS_EXPORT SetPyExecutionModeStr(const std::string& mode);
std::vector<std::string> BASICS_EXPORT GetAllPyExecutionModes();
ADD_EXECUTABLE(SALOME_Container_No_NS_Serv SALOME_Container_No_NS_Serv.cxx)
TARGET_LINK_LIBRARIES(SALOME_Container_No_NS_Serv SalomeContainerServer)
+ADD_EXECUTABLE(SALOME_Container_No_NS_Serv_OutProcess SALOME_Container_No_NS_Serv_OutProcess.cxx)
+TARGET_LINK_LIBRARIES(SALOME_Container_No_NS_Serv_OutProcess SalomeContainerServer)
+
+ADD_EXECUTABLE(SALOME_Container_No_NS_Serv_OutProcess_Replay SALOME_Container_No_NS_Serv_OutProcess_Replay.cxx)
+TARGET_LINK_LIBRARIES(SALOME_Container_No_NS_Serv_OutProcess_Replay SalomeContainerServer)
+
IF(SALOME_BUILD_TESTS)
ADD_EXECUTABLE(TestSalome_file TestSalome_file.cxx)
TARGET_LINK_LIBRARIES(TestSalome_file SALOMETraceCollectorTest ${SALOME_Container_LIBS})
ENDIF()
-INSTALL(TARGETS SALOME_Container SALOME_Container_No_NS_Serv DESTINATION ${SALOME_INSTALL_BINS})
+INSTALL(TARGETS SALOME_Container SALOME_Container_No_NS_Serv SALOME_Container_No_NS_Serv_OutProcess SALOME_Container_No_NS_Serv_OutProcess_Replay DESTINATION ${SALOME_INSTALL_BINS})
# Executable scripts to be installed
SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})
super().__init__(containerName, containerIORStr, dftTimeIntervalInMs)
def getPyScriptCls(self):
- return SALOME_PyNode.PyScriptNode_i
+ return SALOME_PyNode.PyScriptNode_OutOfProcess_Replay_i
#include "Basics_Utils.hxx"
#include "Basics_DirUtils.hxx"
#include "PythonCppUtils.hxx"
+#include "KernelBasis.hxx"
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
return ret;
}
+std::string SALOME_ContainerManager::GetCppBinaryOfKernelSSLContainer() const
+{
+ switch( SALOME::GetPyExecutionMode() )
+ {
+ case SALOME::PyExecutionMode::InProcess:
+ return "SALOME_Container_No_NS_Serv";
+ case SALOME::PyExecutionMode::OutOfProcessNoReplay:
+ return "SALOME_Container_No_NS_Serv_OutProcess";
+ case SALOME::PyExecutionMode::OutOfProcessWithReplay:
+ return "SALOME_Container_No_NS_Serv_OutProcess_Replay";
+ default:
+ {
+ ERROR_MESSAGE("Not manager py execution mode");
+ THROW_SALOME_EXCEPTION("GetCppBinaryOfKernelSSLContainer : Not manager py execution mode");
+ }
+ }
+}
+
std::string SALOME_ContainerManager::GetCppBinaryOfKernelContainer() const
{
- std::string ret = this->_isSSL ? "SALOME_Container_No_NS_Serv" : "SALOME_Container";
+ std::string ret = this->_isSSL ? GetCppBinaryOfKernelSSLContainer() : "SALOME_Container";
return ret;
}
FindContainer(const Engines::ContainerParameters& params,
const std::string& resource);
+ std::string GetCppBinaryOfKernelSSLContainer() const;
+
std::string GetCppBinaryOfKernelContainer() const;
std::string GetRunRemoteExecutableScript() const;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "SALOME_Container_Common.cxx"
-#include "SALOME_Container_i.hxx"
-#include "SALOME_Embedded_NamingService_Client.hxx"
-#include "Utils_SALOME_Exception.hxx"
-#include "SALOME_KernelORB.hxx"
-#include "KernelBasis.hxx"
+#include "SALOME_Container_No_NS_Serv_Generic.hxx"
-int main(int argc, char* argv[])
-{
- if(argc<3)
- THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : requires 2 input arguments <containerName> <IOR of Engines::EmbeddedNamingService>" );
- CORBA::ORB_ptr orb(KERNEL::getORB());
- std::string IOROfEmbeddedNamingService(argv[2]);
- setIOROfEmbeddedNS(IOROfEmbeddedNamingService);
- CORBA::Object_var ns_serv_obj_base = orb->string_to_object(IOROfEmbeddedNamingService.c_str());
- if( CORBA::is_nil(ns_serv_obj_base) )
- THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : argument 2 is NOT a valid IOR" );
- Engines::EmbeddedNamingService_var ns_serv_obj = Engines::EmbeddedNamingService::_narrow(ns_serv_obj_base);
- if( CORBA::is_nil(ns_serv_obj) )
- THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : argument 2 is NOT a valid IOR of Engines::EmbeddedNamingService" );
- std::unique_ptr<SALOME_NamingService_Container_Abstract> ns( new SALOME_Embedded_NamingService_Client(ns_serv_obj) );
- return container_common_main<Engines_Container_SSL_i>(argc,argv,std::move(ns));
-}
+GENERIC_CONTAINER_EXECUTABLE( Engines_Container_SSL_i )
--- /dev/null
+// Copyright (C) 2021-2024 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SALOME_Container_Common.cxx"
+#include "SALOME_Container_i.hxx"
+#include "SALOME_Embedded_NamingService_Client.hxx"
+#include "Utils_SALOME_Exception.hxx"
+#include "SALOME_KernelORB.hxx"
+#include "KernelBasis.hxx"
+
+#define GENERIC_CONTAINER_EXECUTABLE( cls ) \
+int main(int argc, char* argv[]) \
+{ \
+ if(argc<3) \
+ THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : requires 2 input arguments <containerName> <IOR of Engines::EmbeddedNamingService>" ); \
+ CORBA::ORB_ptr orb(KERNEL::getORB()); \
+ std::string IOROfEmbeddedNamingService(argv[2]); \
+ setIOROfEmbeddedNS(IOROfEmbeddedNamingService); \
+ CORBA::Object_var ns_serv_obj_base = orb->string_to_object(IOROfEmbeddedNamingService.c_str()); \
+ if( CORBA::is_nil(ns_serv_obj_base) ) \
+ THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : argument 2 is NOT a valid IOR" ); \
+ Engines::EmbeddedNamingService_var ns_serv_obj = Engines::EmbeddedNamingService::_narrow(ns_serv_obj_base); \
+ if( CORBA::is_nil(ns_serv_obj) ) \
+ THROW_SALOME_EXCEPTION( "SALOME_Container_No_NS_Serv : argument 2 is NOT a valid IOR of Engines::EmbeddedNamingService" ); \
+ std::unique_ptr<SALOME_NamingService_Container_Abstract> ns( new SALOME_Embedded_NamingService_Client(ns_serv_obj) ); \
+ return container_common_main<cls>(argc,argv,std::move(ns)); \
+}
--- /dev/null
+// Copyright (C) 2021-2024 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SALOME_Container_No_NS_Serv_Generic.hxx"
+
+GENERIC_CONTAINER_EXECUTABLE( Engines_Container_SSL_OutOfProcess_i )
--- /dev/null
+// Copyright (C) 2021-2024 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SALOME_Container_No_NS_Serv_Generic.hxx"
+
+GENERIC_CONTAINER_EXECUTABLE( Engines_Container_SSL_OutOfProcess_Replay_i )