From 9bb98b754586afa2fe537c93b89d78a9d49511bd Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 24 Feb 2022 07:30:54 +0100 Subject: [PATCH] Dft SSL : Logger case : WIP --- src/Logger/SALOME_Logger_Server_main.cxx | 3 ++- src/SALOMETraceCollector/CMakeLists.txt | 3 ++- src/SALOMETraceCollector/SALOMETraceCollector.cxx | 12 ++++++++++++ src/Utils/Test/UtilsTest.cxx | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Logger/SALOME_Logger_Server_main.cxx b/src/Logger/SALOME_Logger_Server_main.cxx index b2328f683..a0b60b130 100644 --- a/src/Logger/SALOME_Logger_Server_main.cxx +++ b/src/Logger/SALOME_Logger_Server_main.cxx @@ -32,6 +32,7 @@ #include #include #include +#include "KernelBasis.hxx" #ifndef WIN32 # include @@ -61,7 +62,7 @@ int main(int argc, char **argv) CORBA::Object_var obj; PortableServer::POA_var poa; PortableServer::POAManager_var pman; - + setSSLMode(false); SetArgcArgv(argc, argv); CORBA::ORB_var orb = KERNEL::GetRefToORB() ; diff --git a/src/SALOMETraceCollector/CMakeLists.txt b/src/SALOMETraceCollector/CMakeLists.txt index b6bfd678b..d7cdeab3e 100644 --- a/src/SALOMETraceCollector/CMakeLists.txt +++ b/src/SALOMETraceCollector/CMakeLists.txt @@ -27,13 +27,14 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace ${CMAKE_CURRENT_SOURCE_DIR}/../Basics ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService + ${CMAKE_CURRENT_SOURCE_DIR}/../Logger ${PROJECT_BINARY_DIR}/idl ) ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${PTHREAD_DEFINITIONS}) ADD_LIBRARY(with_loggerTraceCollector SALOMETraceCollector.cxx TraceCollector_WaitForServerReadiness.cxx) -TARGET_LINK_LIBRARIES(with_loggerTraceCollector SalomeNS ArgvKeeper SALOMELocalTrace OpUtil SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PTHREAD_LIBRARIES}) +TARGET_LINK_LIBRARIES(with_loggerTraceCollector SalomeNS ArgvKeeper SALOMELocalTrace SalomeLoggerServer OpUtil SalomeIDLKernel ${OMNIORB_LIBRARIES} ${PTHREAD_LIBRARIES}) INSTALL(TARGETS with_loggerTraceCollector EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/SALOMETraceCollector/SALOMETraceCollector.cxx b/src/SALOMETraceCollector/SALOMETraceCollector.cxx index 716cd5985..82fdc3e67 100644 --- a/src/SALOMETraceCollector/SALOMETraceCollector.cxx +++ b/src/SALOMETraceCollector/SALOMETraceCollector.cxx @@ -209,11 +209,23 @@ SALOMETraceCollector::SALOMETraceCollector() */ // ============================================================================ +#include "KernelBasis.hxx" +#include "SALOME_Logger_Server.hxx" +#include "SALOME_Fake_NamingService.hxx" + +#include + extern "C" { SALOMETRACECOLLECTOR_EXPORT BaseTraceCollector *SingletonInstance(void) { + if(getSSLMode()) + { + SALOME_Logger::Logger_var logger = KERNEL::getLoggerServantSA(); + std::unique_ptr ns(new SALOME_Fake_NamingService); + ns->Register(logger,"/Logger"); + } BaseTraceCollector *instance = SALOMETraceCollector::instance(); return instance; } diff --git a/src/Utils/Test/UtilsTest.cxx b/src/Utils/Test/UtilsTest.cxx index 2f14c1c07..8a3d1dab2 100644 --- a/src/Utils/Test/UtilsTest.cxx +++ b/src/Utils/Test/UtilsTest.cxx @@ -30,6 +30,7 @@ #include "Basics_Utils.hxx" #include "Basics_DirUtils.hxx" #include "utilities.h" +#include "KernelBasis.hxx" #ifdef WIN32 #define setenv Kernel_Utils::setenv @@ -53,6 +54,7 @@ UtilsTest::_getTraceFileName() void UtilsTest::setUp() { + setSSLMode(false); LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance(); CPPUNIT_ASSERT(bp1); bp1->deleteInstance(bp1); -- 2.39.2